Summary of the invention
The invention provides message level processing method in a kind of service-oriented architecture, unusual first grade of definition, identification and analyzing and processing.
For the abnormal conditions in service system structure being unified, being discerned timely and analyzing and processing, the present invention provides unusual definition superspace and unit's level definition structure, the stack information after the reason of multistage local and remote unusual generation accurately, the filtration and generation address information.
In the oriented systems of stratification, each needs unique definition unusually, the superspace of unusual definition can the assurance system in each unusual definition unique locus is arranged, and can obtain unusual definition in the superspace by simple matching algorithm; The unusual definition of different disposal level is distinguished with NameSpace, and the unusual definition of disparate modules or service can be carried out staging treating in the same space, and except that unique principal space, all the other are extending space, and unusual NameSpace structure is:
DS=(PDS,PSGname,DSName),
Wherein PDS is the father space, and the father space of the principal space is empty; PSGname is father's space segment name; DSName is the NameSpace name.
The segmental structure of unusual NameSpace is:
SG=(DS,SGName,FilterItemList,Begin,End),
Wherein, DS is the NameSpace of appointment, and SGName is the segmentation name, and FilterItemList follows the tracks of stack filtercondition item table for this segmentation, and Begin is this section beginning anomalous sign, and End is this section tail anomalous sign.
The superspace structure of unusual definition satisfies following condition:
1, divide NameSpace according to different processing levels or subsystem, the common principal space is used for core layer and defines unusually, and extending space is used for other processing layer and defines unusually;
2, the reserve part of the principal space is used to define common protocol, and employed programming language and system exception are unusual as Java language, the HTTP mistake, and the SOAP mistake, the expansion NameSpace is not established reserve part;
3, according to each layer processing module or service definition, divide each space (keeping the particular section of segmentation) according to fixing or revocable big subsection as the principal space, segmentation is applicable to that the message processing unit level defines unusually usually;
4, each segmentation can select an expansion unusual (section tail) to be used for the expansion of one or more subspaces;
5, the unusual definition of each processing module or service dynamic initialization relevant segments guarantees that unusual definition has unique to search the path from what the principal space began.
Unusual unit's level definition does not rely on concrete programming language, and the realization of message layer abnormality processing can be described this unit level by initialization and be mapped in the programming language structure that is adopted, and unusual first grade of definition structure is:
EIDStruct=(DS,Num,ExDesc,ExType),
Wherein, DS is legal unusual NameSpace, and Num is for distributing to this unusual numbering in designated space, and ExDesc is the non-conformance description explanation, and ExType is Exception Type (keeping item).
The message layer abnormality processing is a bridge that connects different programming languages, processing module, kernel service and specifically use abnormality processing, the design and the realization of execution environment, agreement and standard that particularly service-oriented architecture is relevant, its structure must guarantee in time, provide exactly local and remote unusual identification and analysis processing result, comprise single unusual, multistage unusual structure is defined as follows:
1, single anomaly sxtructure is divided into unusual sign (definition) structure division and abnormal information part, is expressed as:
ExStruc=(EIDStruc,EInfoStruc),
Wherein, EInfoStruc is the abnormal information part, is defined as:
EInfoStruc=(StackTrace,EMInfo,MIDStruc,UDesc,MContent),
Wherein, StackTrace is for filtering the unusual stack information in back, and EMInfo is for embedding abnormal information, and MIDStruc is for abnormal address and message identifier structure take place, and PUDesc is the processing unit descriptor, and MContent is the processing messages content.
2, multistage unexpected message adopts the unusual packing and the conversion process method of downward incremental to construct, and is expressed as:
MultExMsg=(∪EIDStruc,∪EInfoStruc),
Wherein, ∪ EIDStruc is the orderly combination of multistage unusual sign, and ∪ EinfoStruc is the orderly combination of multistage abnormal information.
The message layer abnormality processing adopts unified generation and processing mode, solve about unusual definition, location and decision problem, guarantee in time to transmit multistage accurately abnormal information, the technology of its use comprises anomalous structure and packing, stack filters, the unexpected message coding and decoding technology, the nested technology of unexpected message, specific as follows:
1, structure and packing abnormality processing step are as follows:
1) catches taken place unusual;
2) take a decision as to whether and pack unusually,, then forward the 8th to if packed unusually) step, otherwise continue;
3) the single anomaly sxtructure of initialization;
4) search or discern and define and be provided with unusual sign in the NameSpace unusually;
5) filter current tracking stack and stack information is set;
6), the abnormal information structure is set according to current message context;
7) generate new message layer anomaly sxtructure;
8) return unusually, finish structure or packing processing.
Structural anormaly is that with packing unusual difference the former passes through the unusual NameSpace of coupling (searching) and anomalous sign is provided with unusual sign, and the latter discerns automatically to unusual (unusual as programming language) that capture.
2, the stack filtering technique is according to the filtercondition in the unusual segmentation new stack information is handled and formed to unusual tracking stack, and concrete steps are as follows:
1) reads in the unusual definition superspace filtering item table of unusual segmentation;
2) obtain and tracking stack when unusual takes place buffer memory;
3) read first stack element of tracking stack;
4) read first filtering item in the filter table;
5) relatively follow the tracks of filtering item in stack element and the filter table, if coupling then continues, otherwise jumps to the 7th) step;
6) the tracking stack element that will meet filtercondition in order is as the stack information cache, and jumps to for the 8th step;
7) read next filtering item in the filter table, if non-NULL jumps to the 5th) step, otherwise continue;
8) read tracking stack the next item down stack element of buffer memory, if non-NULL jumps to the 4th) step, otherwise continue;
9) return the stack information that meets filtercondition that is buffered, finish to follow the tracks of stack and filter.
3, for service end take place unusual, the unexpected message encoding process is converting unexpected message unusually to after structure or the packing; Decoding processing is that the long-range unexpected message process that receives is changed and analyzed to client, decoding can be regarded a special packaging process as, this process at first resolves into long-range unexpected message unusual sign (EIDStruc) part and abnormal information (EInfoStruc) part, incremental is constructed multistage unexpected message (MultExMsg) downwards then, and the unexpected message code/decode format is as follows:
1) the non-conformance description information that is hunted down;
2) one group<MLEH:ExceptionID no: 〉,<MLEH:ExceptionDesc no: mark (numbering no distinguishes with the back), wherein ExceptionID information content form is:
" { "+NameSpace+" } "+segmentation name+". "+numbering+". "+type; ExceptionDesc is the non-conformance description explanation;
3) one group<MLEH:ExceptionInfo no:〉mark (numbering no distinguishes with the back), with<MLEH:ExceptionID no: and<MLEH:ExceptionDesc no: corresponding one by one, each ExceptionInfo content is the abnormal information part of a single anomaly sxtructure, promptly filter back stack information (<StackTrace: 〉), embed abnormal information (<EMInfo: 〉), abnormal address and message identifier structure (<MIDStruc:〉take place), processing unit descriptor (<PUDesc: 〉), handled message content (<MContent: 〉).
4, in the unexpected message transmittance process, may take place new unusually, take place to cause losing of original unexpected message unusually midway; For guaranteeing complete unexpected message transmission, the message layer abnormality processing adopts the method that embeds, the original unexpected message of encapsulation in new unexpected message, the embedding abnormal information content (message coding is with<EMInfo:〉that promptly is set in the ExStruc definition is a mark).
The advantage that the present invention has provides the superspace of complete software anomaly definition and unified unit's level define method; In time, accurately handle the abnormality processing technology of local and remote unusual location and unusual nested problem; And help shortening abnormal information identification and transmission time, improve the multiple-stage treatment and the tracking stack filtering technique of the handling property of oriented systems; And then simplified owing to the continuous expansion of system scale increases unusual definition and processing newly, related system, processing module, agreement, standard and Service Design in the particularly service-oriented architecture.
Characteristics of the present invention have:
1, the superspace of unusual definition guarantees the uniqueness and the validity of the unusual definition of oriented systems;
2, the level definition of software anomaly unit does not rely on programming language and concrete software realization;
3, the message layer abnormality processing has reduced the quantity of information of unusual stack effectively by tracking stack filtering technique;
4, the message layer abnormality processing in time offers client to local and remote abnormal information accurately, the processing of especially multistage unexpected message;
5, new unusual to taking place in the unexpected message transmittance process, the message layer abnormality processing provides the disposal route of the original abnormal information of encapsulation.
Good effect of the present invention has: the superspace and unified unusual first grade of definition, identification and the analytical approach of complete unusual definition are provided, and the abnormal information that in time provides local and remote accurately abnormal information and can avoid unusual generation to cause is midway lost problem; Eliminated and used and understanding puzzlement and the incompatible mistake that may cause of processing mode that produces on the different software exception handling; Effectively avoided the appearance of exception handling code unnecessary in the particularly service-oriented architecture of software systems.
Embodiment
101 send service invocation request message among the figure; 102 send the Services Combination call request message; 103 send physics service unexpected message; 104 send the Services Combination unexpected message; 301,306,314 client-side interfaces; 302,307,315 output message processing procedures; 303,308,311,316,320 I/O message; 304,309,312,317 input message processing procedures; 305,310,313,318 service interfaces; 319 standard I/O.
Fig. 1 has provided message layer abnormality processing flow process, message level processing method in a kind of service-oriented architecture, and its principal character is: unified anomalous structure or packing are handled service call are taken place to discern unusually timely and analyzing and processing; Provide multistage long-range accurately unusual generation reason, stack information and address information by unexpected message encoding and decoding processing, its step is as follows:
Step 1: the segmentation of this program is unusual in the user application initialization exception definition space;
Step 2: the user application service invocation request sends call request message by (101); Local unusual if dish out, jump to step 9;
Step 3: this segmentation is unusual in the Services Combination initialization exception definition space; Receive request message from (101); Local unusual if dish out, then jump to step 7;
Step 4: after the request message processing, send the combination request message by (102); Local unusual if dish out, then jump to step 7;
Step 5: physics service call and exception handling procedure are as follows:
1) this segmentation is unusual in the physics service initialization exception definition space;
2) receive the combination request message that sends from (102), and call the combination Request Processing;
3) physics service processing unit is dished out local unusual;
4) the physics service catches that this is unusual;
5) call anomalous structure/packing and handle the generation anomaly sxtructure;
6) call the unexpected message encoding process and generate unexpected message;
7) take place then to jump to 6 unusually if catch) midway;
8) send unexpected message by (103);
9) cancel that this segmentation defines unusually in the abnormal space, finish physics service abnormality processing.
Step 6: it is as follows that Services Combination is handled physics service unexpected message process:
1) Services Combination receives the unexpected message that the physics service sends from (103);
2) unexpected message decoding processing;
3) it is long-range unusual after processing unit is dished out and decoded;
Step 7: the Services Combination exception handling procedure is as follows:
1) Services Combination catching exception;
2) call anomalous structure/packing and handle the generation anomaly sxtructure;
3) call the unexpected message encoding process and generate unexpected message;
4) take place then to jump to 3 unusually if catch) midway;
5) send unexpected message to user application by (104);
6) cancel that this segmentation defines unusually in the abnormal space, finish the Services Combination abnormality processing.
Step 8: it is as follows that user application is handled Services Combination unexpected message process:
1) receives the unexpected message that Services Combination sends by (104);
2) unexpected message decoding processing;
3) it is long-range unusual after processing unit is dished out and decoded;
Step 9: the user application exception handling procedure is as follows:
1) user application catching exception;
2) call anomalous structure/packing and handle the generation anomaly sxtructure;
3) display abnormality result comprises multistage local and remote unusual generation reason, the stack information after the filtration, address information and abnormal information midway.
4) cancel that this segmentation defines unusually in the abnormal space, finish abnormality processing.
Fig. 2 has provided from catching exception to the exception handling procedure of finishing structure or packing.Unpackaged unusual for what capture, initialization exception structure at first searches or discerns that this is unusual in unusual definition superspace, and unusual marking structure is set; Read filtering item table in the space segment then, obtain current unusual tracking stack; Next filter unusual tracking stack element in order according to the filtering item condition, and the stack information behind the cache filter; According to current message context the abnormal information structure is set; Generate the message layer anomaly sxtructure at last, finish structure or packing processing.
In Fig. 3, user application calls net journey interface (301), sends output message (303) through output message processing procedure (302); Net journey service end transport layer receives input message (303), through input message processing procedure (304) and service interface (305) message is passed to the service of net journey; Net journey service call community's interface (306), the output message (308) after output message processing procedure (307) sends processing; Community service end transport layer receives input message (308), and through input message processing procedure (309), service interface (310) passes to community service with message; Community service returns to the service of net journey with result, returns user application behind the net journey service reservation process result then; Other is through net journey calling similarly community/physics service.(311) (312) (313) (314) (315) (316) (317) (318) composition calls the message processing procedure of physics service (as the batch job service) through the net journey among the figure, physics service call resource interface, with execute file with data send the resource service end to and use resource to calculate (as batch job), provide result of calculation by standard input (319) through standard output (319); User application calls net journey service (320) and obtains this result.
Based on message level processing method, the GOS abnormality processing realizes having carried out necessary packing to Java is unusual with mistake, unusual and the mistake of each Java has been distributed an anomalous sign, unified NameSpace (http://org.ict.gos.exception/) and segmentation (GF_PRI_Exp, 0x10-4F), wherein the Java anomalous sign is 0x10-47; The anomalous sign of java error is 0x48-4F, and the descriptive information that Java is unusual is taken from this unusual getMessage () information.
The unusual segmentation of GOS core layer has: community service unusual (GOS_AGORA_ERR), net journey service unusual (GOS_GRIP_ERR), router services unusual (GOS_ROUTER_ERR), security mechanism unusual (GOS_HANDLER_ERR), its NameSpace is " http://org.ict.gos.exception/ ".
The GOS system layer is used for the realization and the expansion of systemic-function, as grid file system, grid batch job disposal system etc.It is unusual to allow the user to define expansion voluntarily in the GOS abnormal mechanism, and the NameSpace that has separately (as the unusual NameSpace of grid file system is: http://org.ict.gos.exception/Hotfile/).In service end, GOS provides the unusual definition (registration) of expansion, function encapsulates and dish out; In client, GOS catches and resolves these expansions unusually by the abnormity processing mechanism of unanimity.The father space that system layer is unusual http://org.ict.gos.exception/ by name, segmentation is called GOS_USR_EXP.
The GOS Physical layer promptly refers to the user oriented functional service that the ISP develops.These services be divided into two kinds unusually: the unusual development library of a kind of GOS of being to use produce or encapsulation unusual; Another kind is not adopt the unusual development library of GOS to produce or encapsulate unusual.For the former, the GOS abnormal mechanism provides the unusual generation of Physical layer, encapsulates, catches and analytical capabilities; The latter belongs to the unusual of client message layer abnormality processing nonrecognition, GOS will be this unusual unified be encapsulated as Physical layer unusually (http://org.ict.gos.exception/, 0x0B).