Summary of the invention
(1) technical matters that will solve
In view of this, one object of the present invention is to provide a kind of emitter for service debug command, for the on-line debugging of service compute and grid computing provides a kind of simple, general and effective service debug command request processing mechanism.
Another object of the present invention is to provide a kind of method that service debug command is handled, for the on-line debugging of service compute and grid computing provides a kind of simple, general and effective service debug command treatment mechanism.
(2) technical scheme
For reaching an above-mentioned purpose, the invention provides a kind of emitter for service debug command, this transmitter comprises:
Debug command I/O processing unit, be used for debug command line output with external unit input to debug command checking and analysis and processing unit, and the debugging result that debug command checking and analysis and processing unit are returned is exported to external display device show;
Debug command checking and analysis and processing unit, be used to judge the type of the debug command row of debug command I/O processing unit input, HELP command is exported to the HELP command processing unit, to inquire about and revise order and export to inquiry and revise the command process unit, control command will be exported to the control command processing unit;
The HELP command processing unit, be used for generating the debugging help information, the debugging enironment attribute being set, and the debugging enironment attribute of debugging help information that will generate and setting is exported to display device by debug command checking and analysis and processing unit and debug command I/O processing unit and is shown according to the HELP command of debug command checking and analysis and processing unit input;
Inquiry and modification command process unit, be used to judge the command type of debug command checking and analysis and processing unit input, create a sub-thread for the asynchronous query order, this sub-thread dispatching debug command message processing unit of creating is exported to the debug command message processing unit with querying command; For synchronous modification order, directly call the debug command message processing unit, will revise order and export to the debug command message processing unit;
The control command processing unit, be used for the control command of debug command checking and analysis and processing unit input is exported to the debug command message processing unit, after receiving the response message that the debug command message processing unit returns, whether the control command of judging the input of debug command checking and analysis and processing unit is the single step order, if then the behavior description that service end address and debug command message processing unit are returned sends to the debug source code start unit; Otherwise the response message that the debug command message processing unit is returned returns to debug command checking and analysis and processing unit;
The debug source code start unit, be used for describing according to service end address that is received from the control command processing unit and corelation behaviour, start debug source code, and carry out context swap by debug command message processing unit and service end, dynamic loading and the order of execution debug source code are debugged the source code of this service behavior;
The debug command message processing unit, be used for to be received from inquiry and revise the inquiry of command process unit and the context swap command request message revising order, be received from the control command of control command processing unit and be received from the debug source code start unit sends to service end, and the response message that will be received from service end returns to inquiry respectively and revises command process unit, control command processing unit and debug source code start unit.
Described inquiry and modification order, control command and debug command are service debug command,
Described debug command message processing unit sends service debug command to service end and comprises two kinds of mode of operations: synchronous and asynchronous working pattern;
The emission process of described synchronous working pattern, the debug command message processing unit was not handled other service debug command request before receiving the response message that service end returns;
The emission process of described asynchronous working pattern, the debug command message processing unit need not waited for the response message that service end is returned, and can handle next service debug command request.
The structure of described service debug command comprises: system debug address of service sda, call operation title opn, debugged service call sign dsid and expression formula definition expr can be expressed as CF=(sda, opn, dsid, expr) four parts; Wherein,
System debug address of service sda is used to represent the service call address of standard, is a service debugging enironment attribute, and the service debug command emission process can be by the option acquisition system debug address of service of appointment;
Call operation title opn is consistent with the service debug command name;
Debugged service call sign dsid is used to represent controlled service end services request, is that the overall situation is unique, and the service debug command emission process can obtain debugged service call sign by option;
Expression formula definition expr is used for being provided with, calling, inquiring about or revise the respective element of serving debugging enironment and remote service context.
Described expression formula occurs at the capable rear portion of input command, and the null representation formula represents that this service debug command does not need to import expression formula;
The element decollator of expression formula inside is used to distinguish multistage service context element, appears at the left end of binary expression formula;
Equal sign is used to express an equation, the contextual element of equation left end specified services, and the equation right-hand member is an element value to be revised.
Described debug source code start unit is further used for and need carrying out the service behavior of moving under the situation of debug source code, describe according to service end address that is received from the control command processing unit and corelation behaviour, read outside debug source code configuration file; And, obtain current service end service context message by the service context request, and re-construct the service behavior that service context and loading are moved in this locality according to corresponding configuration startup local source code debugging environment; Under this debugging enironment, carry out the service behavior of being moved into; Use corresponding source code debugger that this service behavior is carried out debug source code; When the service behavior of being moved into is carried out end, send this service context message to service end, and return the service debug process.
For reaching above-mentioned another purpose, the invention provides a kind of method that service debug command is handled, this method comprises:
Step S1: the service debug command that emitter for service debug command reads external unit input is capable, and whether service for checking credentials debug command row is the service debug command request, if, execution in step S2 then; Otherwise, jump to step S1;
Step S2: whether emitter for service debug command service for checking credentials debug command row is the HELP command request, if, execution in step S3 then; Otherwise, execution in step S4;
Step S3: emitter for service debug command jumps to step S11 after calling and carry out and helping processing unit;
Step S4: emitter for service debug command judge service debug command capable whether be asynchronous service debug command request, if, execution in step S5 then; Otherwise, execution in step S6;
Step S5: emitter for service debug command is created asynchronous request thread, and main thread is back to step S1;
Step S6: emitter for service debug command debug command message processing unit calls control command/inquiry and revises command process, carry out the analysis of debug command row, system debug address of service and call operation name thereof are set, the sign of debugged service call and expression formula thereof;
Step S7: emitter for service debug command is according to the system debug address of service, and definite service debug command request message processing procedure of being called sends command request message to server end;
Step S8: emitter for service debug command receives the debug command response message that service end is returned;
Step S9: emitter for service debug command judges whether need to start debug source code, if desired, and execution in step S10 then; Otherwise, execution in step S11;
Step S10: emitter for service debug command reads the exterior arrangement file and starts configurable debug source code environment, obtain the current service context from service end, load and carry out the behavior of moving into, when debug source code finishes, send service context message to service end, and withdraw from the debug source code environment;
Step S11: handle and the demonstration return results.
The service debug command behavior of the input of external unit described in the step S1: from the debugging control platform, or the service debug command of the input of the control window under the Integrated Development Environment is capable.
(3) useful effect
From technique scheme as can be seen, the present invention has following beneficial effect:
1, the invention provides the emitter for service debug command of employing index plane, handle service debug command request and response message to service agreement; Compare with traditional debugging technique, the present invention has eliminated in mandatory debugging enironment the restriction to the service debugging of special-purpose debugging standard and agreement.
2, the invention provides according to the service debug command function, mode of operation, and the local and remote service debug command disposal route of calling, this method provides a kind of simple, general and effective service debug command transaction module and mechanism for the exploitation of the service debugging acid of service compute and grid computing.
3, the invention provides and be used to control the debugged service call behavior of service end, inquire about and revise debugged service call context, the service debug command collection of local debugging enironment attribute is set.
4, the invention provides configurable service behavior debug source code unit, this unit is activated when needs carry out the single step debug source code to the service behavior of moving into, for the service debugging provides a kind of online stratification solution from the message layer to the debug source code.
5, the invention provides the debug command request and the response message processing procedure of WWW and mesh services, support is with the system debug service call of web services and mesh services interface, solved the service debug command Message Processing problem of non-invasion on-line debugging Front-end Design and realization in service compute and grid computing.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, below in conjunction with specific embodiment, and with reference to accompanying drawing, the present invention is described in more detail.
As shown in Figure 1, Fig. 1 is the structured flowchart of emitter for service debug command provided by the invention, and this emitter for service debug command comprises debug command I/O processing unit 10, debug command checking and analysis and processing unit 11, HELP command processing unit 12, inquiry and revises command process unit 13, control command processing unit 14, debug source code start unit 15 and debug command message processing unit 16.
Wherein, debug command I/O processing unit 10 is used for debug command line output with external unit input to debug command checking and analysis and processing unit 11, and the debugging result that debug command checking and analysis and processing unit 11 are returned is exported to external display device shows.
Debug command checking and analysis and processing unit 11 are used to judge the type of the debug command row of debug command I/O processing unit 10 inputs, HELP command is exported to HELP command processing unit 12, to inquire about and revise order and export to inquiry and revise command process unit 13, control command will be exported to control command processing unit 14.
HELP command processing unit 12 is used for generating the debugging help information, the debugging enironment attribute being set according to the HELP command of debug command checking and analysis and processing unit 11 inputs, and the debugging enironment attribute of debugging help information that will generate and setting is exported to display device by debug command checking and analysis and processing unit 11 and debug command I/O processing unit 10 and shown.
Inquiry and modification command process unit 13 are used to judge the command type of debug command checking and analysis and processing unit 11 inputs, create a sub-thread for the asynchronous query order, this sub-thread dispatching debug command message processing unit 16 of creating is exported to debug command message processing unit 16 with querying command; For synchronous modification order, directly call debug command message processing unit 16, will revise order and export to debug command message processing unit 16.
Control command processing unit 14 is used for the control command of debug command checking and analysis and processing unit 11 inputs is exported to debug command message processing unit 16, after receiving the response message that debug command message processing unit 16 returns, whether the control command of judging debug command checking and analysis and processing unit 11 inputs is the single step order, if then the behavior description that service end address and debug command message processing unit are returned sends to debug source code start unit 15; Otherwise the response message that debug command message processing unit 16 is returned returns to debug command checking and analysis and processing unit 11;
Debug source code start unit 15 is used for describing according to service end address that is received from control command processing unit 14 and corelation behaviour, start debug source code, and carry out context swap by debug command message processing unit 16 and service end, dynamic loading and the order of execution debug source code are debugged the source code of this service behavior;
Debug command message processing unit 16 be used for will be received from inquiry and revise the inquiry of command process unit 13 and the context swap command request message revising order, be received from the control command of control command processing unit 14 and be received from debug source code start unit 15 sends to service end, and the response message that will be received from service end returns to inquiry respectively and revises command process unit 13, control command processing unit 14 and debug source code start unit 15.
Principle of work of the present invention and feature thereof will become obviously from following description, maybe can be by as described below practice of the present invention is understood.
For the far call request, the service debug command emission process is divided into two kinds of mode of operations: synchronous and asynchronous request; Its difference is that emission process is before service debug command request responding message is returned in the synchronous working pattern, do not handle other service debug command request, and emission process need not wait for that returning response message can handle next service debug command request in the asynchronous request.
The service debug command structure mainly comprises following four parts: 1) system debug address of service (sda), 2) call operation title (opn), 3) debugged service call sign (dsid) and 4) expression formula definition (expr); Can be expressed as CF=(sda, opn, dsid, expr).System debug address of service (sda) is as a service debugging enironment attribute, it is expressed as the service call address (as http://localhost:8080/axis/services/VegaDebugService) of a standard, and the service debug command emission process can obtain the system debug address of service by the option of appointment.Call operation title (opn) is consistent with the service debug command name.Debugged service call sign (dsid) is that the overall situation is unique, and it represents controlled service end services request, and the service debug command emission process can obtain debugged service call sign by option.Expression formula definition (expr) is provided with, calls, inquires about or revise the respective element in service debugging enironment and the remote service context.Expression formula occurs at the capable rear portion of input command, and the null representation formula represents that this service debug command does not need to import expression formula.The element decollator (.) of expression formula inside is distinguished multistage service context element, and decollator can only appear at the left end of binary expression formula.Equal sign (=) is expressed an equation, the contextual element of equation left end specified services, and the equation right-hand member is an element value to be revised.
A service debug command capable (CmdLine) can be a control command row (CtlLine), or an inquiry and revise order line (QULine), or a HELP command capable (HlpLine).Its syntactic representation is:
CmdLine→CtlLine|QULine|HlpLine
The control command row is made up of a control command (CtlCmd) and controlled variable (CtlArgs) thereof, and its syntactic representation is:
CtlLine→CtlCmd?CtlArgs
Control command (CtlCmd) is the operation name of calling system debugging services.Its controlled variable (CtlArgs) comprises system debug address of service option (r xxx), debugged service call sign option (m yyy), and optional constant expression (ConstString), and its syntactic representation is:
CtlArgs→RmtMark[Dot|ConstString|McidArgs]
RmtMark→Minus?RChar
Minus→-
RChar→r|R
Dot→.
McidArgs→McidMark?ConstString[ConstString]
McidMark→Minus?MChar
MChar→m|M
Inquiry and modification order line (QULine) order (QUCmd) and inquiry and modification parameter (QUArgs) thereof to form by an inquiry and modification, and its syntactic representation is:
QULine→QUCmd?QUArgs
Inquire about and revise order (QUCmd) for one and be the operation name of system debug service call.Inquiry and modification parameter (QUArgs) comprise system debug address of service option (r xxx), debugged service call sign option (m yyy), and inquiry and modification expression formula (QUExpr), and its syntactic representation is:
QUArgs→CtlArgs?QUExpr
QUExpr→Empty|Variable|QUExpr?Dot?Variable|QUEqu
Empty→null
QUEqu→QUMark?QUExpr?Equal?ConstString
Equal→=
QUMark→[Minus?QUType|ClearMark]
QUType→boolean|byte|integer|char|long|float|double|string|list
ClearMark→Minus?ClearString
ClearString→clear
Variable→Identifier
HELP command is capable to be made up of a HELP command (HlpCmd) and an optional constant expression (ConstString), and its syntactic representation is:
HlpLine→HlpCmd[ConstString]
Following table 1 shows the syntactic structure of complete service command collection and expression formula definition thereof.Wherein nonterminal ConstString represents a character string that does not contain variable, and with the nonterminal representative control implication that Ctl begins, with nonterminal representative inquiry and modification implication that QU begins, the nonterminal representative that begins with Hlp helps implication.
Table 1
The basic step of service debugging is divided into: (1) observes the symptom that service behavior goes wrong; (2) wrong behavior source appears in the location; (3) determine wrong reason; The scheme of (4) implementation modification mistake; (5) test invoked behavior again.
Service debug command should provide the function of the needed observation of above step, modification and control service behavior, considers that simultaneously the performance issue service debug command of service debugging can be handled according to mode of operation and local and remote request.As mentioned above, control command belongs to synchronous remote request; Inquiry and modification order are divided into long-range asynchronous query and remote synchronization modification request; HELP command belongs to synchronous local request.
The debugging Request Processing is responsible for debug command request message is sent to service end in the service debug command message processing procedure.For example: web service request is handled the order that sends the stateless web services behavior of debugging, and its message processing procedure is observed relevant web services standard; Same mesh services Request Processing sends the order that debugging has the mesh services behavior of state, and its message processing procedure is observed relevant mesh services standard.The maximum difference of the two is the processing of associative operation input parameter, and WWW system debug service call is supported zero or a plurality of input parameter, and the grid system debugging services need reconstitute all input parameters an input parameter.
Below provide the WWW of service debug command and the false code that mesh services is called respectively.
1, the false code of web services message call processing procedure:
2, the false code of mesh services message call processing procedure:
Configurable debug source code processing unit is to be activated under the situation that need carry out debug source code to the service behavior of moving in the service debug command emission process.This unit at first reads outside debug source code configuration file; Start local source code debugging environment according to configuration accordingly then, obtain current remote service context message, and re-construct the service behavior that service context and loading are moved in this locality by context request; The last service behavior of being moved into of under this debugging enironment, carrying out.Use corresponding source code debugger to carry out debug source code to this service behavior.When the service behavior of being moved into is carried out end, send this service context message, and return the service debug process.
The present invention has provided and has supported synchronously and the service debug command launching technique of asynchronous working pattern that this method is supported the debug command request and the response of WWW and mesh services standard.Service debug command is divided into following three classes by its function, mode of operation and Local or Remote request: control command, inquiry and modification order, and HELP command.Control command belongs to synchronous remote request; Inquiry and modification order are divided into long-range asynchronous query and remote synchronization modification request; HELP command belongs to synchronous local request.
Based on the structured flowchart of the described emitter for service debug command of Fig. 1, and above-mentioned description, below the method that service debug command is handled provided by the invention is elaborated to the principle of the invention and concrete practice.
As shown in Figure 2, Fig. 2 is the realization flow figure that service debug command is handled provided by the invention, and this method comprises:
Step S1: the service debug command that emitter for service debug command reads external unit input is capable, and whether service for checking credentials debug command row is the service debug command request, if, execution in step S2 then; Otherwise, jump to step S1;
In this step, the service debug command behavior of described external unit input: from the debugging control platform, or the service debug command of the input of the control window under the Integrated Development Environment is capable.
Step S2: whether emitter for service debug command service for checking credentials debug command row is the HELP command request, if, execution in step S3 then; Otherwise, execution in step S4.
Step S3: emitter for service debug command jumps to step S11 after calling and carry out and helping processing unit.
Step S4: emitter for service debug command judge service debug command capable whether be asynchronous service debug command request, if, execution in step S5 then; Otherwise, execution in step S6.
Step S5: emitter for service debug command is created asynchronous request thread, and main thread is back to step S1.
Step S6: emitter for service debug command debug command message processing unit calls control command/inquiry and revises command process, carry out the analysis of debug command row, system debug address of service and call operation name thereof are set, the sign of debugged service call and expression formula thereof.
Step S7: emitter for service debug command is according to the system debug address of service, and definite service debug command request message processing procedure of being called sends command request message to server end.
Step S8: emitter for service debug command receives the debug command response message that service end is returned.
Step S9: emitter for service debug command judges whether need to start debug source code, if desired, and execution in step S10 then; Otherwise, execution in step S11.
Step S10: emitter for service debug command reads the exterior arrangement file and starts configurable debug source code environment, obtain the current service context from service end, load and carry out the behavior of moving into, when debug source code finishes, send service context message to service end, and withdraw from the debug source code environment.
Step S11: handle and the demonstration return results, and be back to step S1.
For the method that service debug command is handled provided by the invention is described in further detail, below this is further described.
As shown in Figure 3, Fig. 3 is the specific implementation process flow diagram that service debug command is handled provided by the invention, and this method specifically comprises:
Step 301: debug command I/O processing unit with the debug command line output of external unit input to debug command checking and analysis and processing unit.
Step 302: debug command checking and analysis and processing unit are judged the type of the debug command row of input;
1) if debug command behavior HELP command, then execution in step 303;
2) if debug command behavior inquiry and modification are ordered, then execution in step 304;
3) if debug command behavior control command, then execution in step 305;
4) otherwise, return step 301.
Step 303: debug command checking and analysis and processing unit are exported to the HELP command processing unit with HELP command, the HELP command processing unit generates the debugging help information, the debugging enironment attribute is set according to the HELP command of input, and the debugging enironment attribute of debugging help information that will generate and setting exports to display device by debug command checking and analysis and processing unit and debug command I/O processing unit and shows, and returns step 301.
Step 304: debug command checking and analysis and processing unit will inquire about and revise order and export to inquiry and revise the command process unit, the command type of inquiry and the input of modification command process unit judges;
1) if the asynchronous query order is then inquired about and revised the command process unit and creates a sub-thread, the sub-thread dispatching debug command message of this of establishment processing unit is exported to the debug command message processing unit with querying command, execution in step 308;
2) if revise order synchronously, then inquire about and revise command process cell call debug command message processing unit, will revise order and export to debug command message processing unit, execution in step 308.
Step 305: debug command checking and analysis and processing unit are exported to the control command processing unit with control command, and the control command processing unit is exported to the debug command message processing unit, execution in step 308 with the control command of input.
Step 306: after receiving the response message that the debug command message processing unit returns, debug command checking and analysis and processing unit judge whether the control command of debug command checking and analysis and processing unit input is local single-step debug order, if then execution in step 307; Otherwise, execution in step 309.
Step 307: the control command processing unit sends to the debug source code start unit with service end address and corelation behaviour description, the debug source code start unit is described according to service end address that receives and corelation behaviour, start debug source code, and carry out context swap by debug command message processing unit and service end, dynamic loading and the order of execution debug source code, source code to this service behavior is debugged, when debug source code finishes, send service context message to service end, and withdraw from the debug source code environment.
Step 308: the debug command message processing unit sends to service end with the service debug command that receives, and the response message that will be received from service end returns to inquiry respectively and revises command process unit, control command processing unit and debug source code start unit; If step 306 is then returned in the control command request; Otherwise, execution in step 309.
Step 309: inquiry and revise the command process unit and the control command processing unit is exported to external display device with the response message that receives by debug command checking and analysis and processing unit and debug command I/O processing unit and shown, and return step 301.
Above-described specific embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above only is specific embodiments of the invention; be not limited to the present invention; within the spirit and principles in the present invention all, any modification of being made, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.