CN101620567A - Error locating auxiliary method and device - Google Patents

Error locating auxiliary method and device Download PDF

Info

Publication number
CN101620567A
CN101620567A CN200910165226A CN200910165226A CN101620567A CN 101620567 A CN101620567 A CN 101620567A CN 200910165226 A CN200910165226 A CN 200910165226A CN 200910165226 A CN200910165226 A CN 200910165226A CN 101620567 A CN101620567 A CN 101620567A
Authority
CN
China
Prior art keywords
service processing
processing unit
error messages
sign
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN200910165226A
Other languages
Chinese (zh)
Inventor
周伟明
章乐焱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hundsun Technologies Inc
Original Assignee
Hundsun Technologies Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hundsun Technologies Inc filed Critical Hundsun Technologies Inc
Priority to CN200910165226A priority Critical patent/CN101620567A/en
Publication of CN101620567A publication Critical patent/CN101620567A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses an error locating auxiliary method, comprising the following steps: when a business treatment unit returns a business treatment error message, a mark of the business treatment unit is added in the business treatment error message; and when each level of upper layer business treatment unit of the business treatment unit is transferred to receive the business treatment error message, and needs to transfer and return from the upper layer thereof, a mark of each level upper layer business treatment unit is added in the business treatment error message according to a transferring sequence until a client receives the business treatment error message. Therefore, the invention only reversely generates a transferring sequence when having an error, thereby lowering the maintenance expense needed by the error location.

Description

A kind of error locating auxiliary method and device
Technical field
The present invention relates to field of information processing, particularly relate to a kind of error locating auxiliary method and device.
Background technology
In the transaction processing system of sandwich construction, along with the raising of portfolio, system realizes becoming increasingly complex, and is rendered as typical multi-layer framework usually.Under this multilayer application architecture, the business processing request of a client initiation is sent on the correspondent service logic layer application server by communication middleware to be handled, and in the processing procedure of Business Logic application server, business processing is finished in the service that may need repeatedly to call different atomic service layer application servers provides together, by the Business Logic application server result is returned client at last.
In the performance history of this type systematic, because the possibility that system complex causes service error and system mistake occurring also improves thereupon, therefore when system exception occurring, navigating to the program element of makeing mistakes fast just becomes the technology difficulty that will solve.
Originally can adopt the mode of error code to show mistake usually; promptly the uniqueness by error code identifies the kind that makes a mistake; perhaps adopt the fuzzy mode that reports an error to show mistake; but these methods all inevitably exist the shared routine unit when reporting an error, and can't determine what which program element caused calling of it.But in fact, not only to know the function name of makeing mistakes when makeing mistakes, need also to know the function of makeing mistakes is by which function call.
For addressing the above problem, prior art can be analyzed business processing flow, the program element of all execution is followed the tracks of one by one, to find error reason.For example, the inlet of each function call that can be in program is safeguarded a call stack with outlet, when the function of each program element enters and withdraws from, by call stack record function call sequence, reflect the function name of makeing mistakes with this, and the function of makeing mistakes is by which function call.
But, in the method for the prior art, no matter handle normally or make mistakes, all need to safeguard call stack, therefore there is the expense of safeguarding call stack.Especially when system was very complicated, maintenance costs can be bigger, even influence system performance.
Summary of the invention
In view of this, the object of the present invention is to provide a kind of location of mistake method and device, can accurately locate errors present, and reduce the required maintenance costs of location of mistake.
For achieving the above object, the invention provides following scheme:
A kind of error locating auxiliary method comprises:
When Service Processing Unit returns the business processing error messages, the sign of described Service Processing Unit is appended in the described business processing error messages;
When its upper strata is called and is returned on the upper-layer service processing units at different levels that call described Service Processing Unit receive described business processing error messages and need, sign with described upper-layer service processing units at different levels appends in the described business processing error messages according to calling order respectively, receives the business processing error messages that includes the Service Processing Unit calling sequence up to request initiating terminal through taking.
Preferably, also comprise:
The described request originating end according to the sign of calling the additional Service Processing Units at different levels of order, carries out location of mistake according to described.
Preferably, the mode by generating call stack is attached to the sign of Service Processing Units at different levels in the described business processing error messages.
Preferably, described Service Processing Unit comprises function or service; The sign of described Service Processing Unit comprises function name or Service name.
Preferably, described Service Processing Unit and the upper-layer service processing units at different levels that call described Service Processing Unit are same in-process or be distributed on a plurality of processes of multiple servers.
Preferably, also comprise:
Analyze described Service Processing Unit calling sequence, identify the Service Processing Unit of far call respectively, and the Service Processing Unit that is called as inner subfunction by last function.
A kind of location of mistake servicing unit comprises:
The sign of makeing mistakes add-on module is used for when Service Processing Unit returns the business processing error messages, and the sign of described Service Processing Unit is appended in the described business processing error messages;
Classification sign add-on module, be used for calling when returning when the upper-layer service processing units at different levels that call described Service Processing Unit receive on described business processing error messages and needs its upper strata, sign with described upper-layer service processing units at different levels appends in the described business processing error messages according to calling order respectively, receives the business processing error messages that includes the Service Processing Unit calling sequence up to client.
Preferably, the mode by generating call stack is attached to the sign of Service Processing Units at different levels in the described business processing error messages.
Preferably, described Service Processing Unit comprises function or service; The sign of described Service Processing Unit comprises function name or Service name.
Preferably, described Service Processing Unit and the upper-layer service processing units at different levels that call described Service Processing Unit are same in-process or be distributed on a plurality of processes of multiple servers.
Preferably, also comprise:
Analysis module is used to analyze described Service Processing Unit calling sequence, identifies the Service Processing Unit of far call respectively, and the Service Processing Unit that is called as inner subfunction by last function.
According to specific embodiment provided by the invention, the invention discloses following technique effect:
The present invention can work as Service Processing Unit when returning the business processing error messages, and the sign of described Service Processing Unit is appended in the described business processing error messages; And, when its upper strata is called and is returned on the upper-layer service processing units at different levels that call described Service Processing Unit receive described business processing error messages and need, sign with described upper-layer service processing units at different levels appends in the described business processing error messages according to calling order respectively, receives described business processing error messages up to client.As seen, the present invention only just oppositely generates calling sequence (being illustrated according to the sign of calling the additional Service Processing Units at different levels of order by described) when makeing mistakes, therefore, under the normal situation of most of business processing, do not have overhead, thereby reduced the required maintenance costs of location of mistake on the whole.
In addition, the said method that provides by the embodiment of the invention, the inner function calls of the far call of striding course and process, in full accord in the processing of error messages, therefore, the Service Processing Units that call at different levels can also can be distributed on a plurality of processes of multiple servers same in-process.
Description of drawings
Fig. 1 is the process flow diagram of the method that provides of the embodiment of the invention;
Fig. 2 is the process flow diagram of the other method that provides of the embodiment of the invention;
Fig. 3 is the schematic representation of apparatus that the embodiment of the invention provides.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
Referring to Fig. 1, the error locating auxiliary method that the embodiment of the invention provides may further comprise the steps:
S101: when Service Processing Unit returns the business processing error messages, the sign of described Service Processing Unit is appended in the described business processing error messages;
S102: when its upper strata is called and returned on the upper-layer service processing units at different levels that call described Service Processing Unit receive described business processing error messages and need, sign with described upper-layer service processing units at different levels appends in the described business processing error messages according to calling order respectively, receives described business processing error messages up to client.
At first need to prove, the embodiment of the invention is based on message communicating and processing platform, the infosystem that makes up on this platform can be handled by multi-process, it is a kind of framework based on service, be that message communicating and processing platform externally provide service (user of service can be called client) in the far call mode, when service realizes, might call the service (being called sub-services) that other message communicating breaths and platform provide.Finish message exchange by message communicating between user, a plurality of message communicating and the processing platform of service, generally be not to use the person to send request message, echo reply message after the platform processes request message.
In order to carry out location of mistake exactly, reduce the maintenance costs that the location of mistake process is brought again on the whole, the embodiment of the invention can be developed a kind of instrument, and is carried out the step of described S101 and S102 by this instrument.Concrete, what described instrument need be done is exactly before Service Processing Units at different levels return error messages, the sign of current business processing unit is attached in the error messages according to calling order, so that client is carried out location of mistake according to calling sequence.
Wherein, described Service Processing Unit can be a kind of function or a service, and this function or service can be finished certain business processing by other function or service call.Accordingly, the sign of described Service Processing Unit can be function name or Service name.When certain Service Processing Unit A calls Service Processing Unit B, Service Processing Unit B needs to return response message to Service Processing Unit A after finishing corresponding service processing, concrete, if complete successfully business processing, then return success message, otherwise return the business processing error messages to Service Processing Unit A.
But, business processing error messages of the prior art only comprises error code, and the client that sends request only can know that finally business processing made mistakes, and wrong type, but and do not know where mistake is emitted in, be the mistake that in which invoked procedure, occurs.For this reason, the embodiment of the invention can be when Service Processing Unit returns the business processing error messages, the sign of described Service Processing Unit is appended in the described business processing error messages, like this, at first can identify which Service Processing Unit mistake has taken place, and, identify the sequence of calling by follow-up processing, so just the function call sequence can be offered client, be convenient to client and determine the accurate position of makeing mistakes.
During specific implementation, can adopt the mode of record call stack to write down the function call sequence, transfer the B function such as the A function, the B function calls the C function again, then can be recorded as call stack A->B->C.Like this, if function C is made mistakes in the process of implementation, call stack (C) is being appended in the error messages, and returning to function B by function C; Then at function B when function A returns error messages, with call stack (B->C) append in the error messages; Equally, at function A before client is returned error messages, with call stack (A->B->C) be attached in the error messages.Like this, client just can be known the function calls sequence by call stack.
Need to prove that the embodiment of the invention only need be when returning the business processing error messages, the generating function calling sequence, when business processing just often, do not need to carry out the step of additional identification.And in most cases, business processing is normal, therefore, for transaction processing system, has lowered on the whole and has carried out the required expense of location of mistake.
The Service Processing Unit A that makes mistakes returns to the business processing error messages upper-layer service processing unit B that calls this Service Processing Unit, if this upper-layer service processing unit B is called by upper-layer service processing unit C, then Service Processing Unit B need continue the business processing error messages is returned to its upper-layer service processing unit C.Before returning to upper-layer service processing unit C, the sign of Service Processing Unit B need be attached in the described business processing error messages equally.
Equally, Service Processing Unit C is after receiving the business processing error messages, if this Service Processing Unit C is called by upper-layer service processing unit D, then Service Processing Unit C need continue the business processing error messages is returned to its upper-layer service processing unit D.Before returning to upper-layer service processing unit D, the sign of Service Processing Unit C need be attached in the described business processing error messages equally.By that analogy, know with the business processing error messages turn back to the request person's of sending (as client).
The sign of upper-layer service processing units at different levels is attached in the business processing error messages according to calling order, therefore, the request person of sending just can be from the business processing error messages of receiving, know the Service Processing Unit of makeing mistakes, and calling in proper order between the Service Processing Units at different levels that relate in the whole invoked procedure, so just finished location of mistake exactly.
In actual applications, can in the response message of Service Processing Units at different levels, comprise specific error message.Like this, error message just can be transmitted between a plurality of processes of whole system, and can realize depositing error message by calling order.Simultaneously, the sign that comprises the Service Processing Unit of makeing mistakes in the described error message; In the transmittance process of error message, every through the one-level Service Processing Unit, just the sign with the appropriate level Service Processing Unit is attached in the error message.
That is to say, in the embodiment of the invention, in the calling interface between the Service Processing Unit, can comprise a specific error message return parameters; This error message return parameters comprises the Service Processing Unit of makeing mistakes and the sign of upper-layer service processing units at different levels.Therefore for the embodiment of the invention, the inner subfunction of the far call of striding course and process is called, and is in full accord on error message.Simultaneously, for a service process, call that lower floor's Service Processing Unit (calling business processing function or far call sub-services) is made mistakes and when returning error message, last layer functions or sub-services also can continue on it layer functions or sub-services is returned error message, and when returning current function name (Service name) are appended to after the error message that bottom returns.In the error message in the response message that client is received, promptly comprise the whole calling sequence of the function of makeing mistakes like this, be convenient to the analyzing and positioning reason of makeing mistakes.
In addition, because in the service process, some Service Processing Unit may be a far call, also some Service Processing Unit may be the inside subfunction of last function, therefore, the embodiment of the invention is after getting access to the business processing error messages that includes the Service Processing Unit calling sequence, can also analyze described Service Processing Unit calling sequence, judge in each Service Processing Unit that relates in the calling sequence, which is a far call, and which is the inside subfunction of last function.Concrete determination methods can be:
Is to need unified registration management by the Service Processing Unit of far call as a kind of service of external announcement, can identify according to the information of registration which is the Service name of far call in the calling sequence, in addition be exactly the intrinsic function name.And, can judge two function names between the Service name, be the intrinsic function that previous service is called, because agreement is returned when makeing mistakes when sub-services, service itself is also regarded as to make mistakes and is returned, and can not continue to call intrinsic function or other sub-services, realizes obtaining simplifying thereby make.
In order to understand the technical scheme that the embodiment of the invention provides better, describe in detail below by concrete application.
As shown in Figure 2, wherein func1 is an external service, for client call (generally being far call); The function that func2 is called by func1 also can be by the sub-services of func1 far call; The function that called by func2 of func3 in like manner also can be by the sub-services of func2 far call.
In general the realization of func1 not only comprises invoked procedure shown in Figure 2, also can call other functions or sub-services such as it before and after calling func2; Same func3 also may be by other functions or service call except after may being called by func2.So,, just can know and know that func3 calls func2 because of func1, call the mistake that goes out under the situation of a kind of like this calling sequence of func3 by func2 again, like this with regard to the easier analysis reason of makeing mistakes by returning calling sequence when func3 handles when makeing mistakes.
Concrete, can may further comprise the steps:
S201: request function func1; Client call func1 realizes business processing;
S202:func1 call function func2; Be that func1 needs call function func2 in carrying out the business processing process; Certainly, func1 also may need to call other functions or service, and is not shown;
S203:func2 call function func3; Be that func2 needs call function func3 in carrying out the business processing process; Certainly, func2 also may need to call other functions or service, and same, func3 also may be called other functions or service by other, and is not shown;
S204:func3 makes mistakes in the process of carrying out business processing, then needs to return error messages to func2; At this moment, before func2 returned error messages, recording exceptional call stack (func3) returned error messages to func2 then at func3; Wherein, described exception call stack (func3) can be attached to and return to func2 on the error messages; Described func3, func2, func1 are respectively the function name of each function;
S205:func2 need return error messages to func1 after receiving error messages; Equally, before returning, recording exceptional call stack (func2->func3), return error messages to func1 then; Wherein, (func2->func3) can be attached to and return to func1 on the error messages described exception call stack;
S206: last, func1 need return error messages to client after receiving error messages; Equally, before returning, the recording exceptional call stack (func1->func2->func3), and (error messages of func1->func2->func3) returns to client will to carry this exception call stack.Client can be looked for (the position that func1->func2->func3) makes mistake and takes place according to the exception call stack.
Certainly client is received after this error message, which is a far call can also to utilize the function call sequence that comprises in the described tool analysis business processing of the embodiment of the invention error messages, which is the inside subfunction of last function, thereby can determine that every partial function is processed on which process.
Corresponding with the location of mistake method that the embodiment of the invention is provided, the embodiment of the invention also provides a kind of location of mistake servicing unit, and referring to Fig. 3, this device comprises:
The sign of makeing mistakes add-on module U301 is used for when Service Processing Unit returns the business processing error messages, and the sign of described Service Processing Unit is appended in the described business processing error messages;
Classification sign add-on module U302, be used for calling when returning when the upper-layer service processing units at different levels that call described Service Processing Unit receive on described business processing error messages and needs its upper strata, sign with described upper-layer service processing units at different levels appends in the described business processing error messages according to calling order respectively, receives the business processing error messages that includes the Service Processing Unit calling sequence up to client.
Concrete, mode that can be by generating call stack is attached to the sign of Service Processing Units at different levels in the described business processing error messages.
Wherein, described Service Processing Unit comprises function or service; Accordingly, the sign of described Service Processing Unit comprises function name or Service name.
In the practical application, described Service Processing Unit and call the upper-layer service processing units at different levels of described Service Processing Unit can be same in-process or be distributed on a plurality of processes of multiple servers.
Because in the service process, some Service Processing Unit may be a far call, also some Service Processing Unit may be the inside subfunction of last function, therefore, the embodiment of the invention can also be analyzed described Service Processing Unit calling sequence after getting access to the business processing error messages that includes the Service Processing Unit calling sequence, judges in each Service Processing Unit that relates in the calling sequence, which is a far call, and which is the inside subfunction of last function.
At this moment, described device can also comprise:
Analysis module is used to analyze described Service Processing Unit calling sequence, identifies the Service Processing Unit of far call respectively, and the Service Processing Unit that is called as inner subfunction by last function.
More than to a kind of error locating auxiliary method provided by the present invention and device, be described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, part in specific embodiments and applications all can change.In sum, this description should not be construed as limitation of the present invention.

Claims (11)

1, a kind of error locating auxiliary method is characterized in that, comprising:
When Service Processing Unit returns the business processing error messages, the sign of described Service Processing Unit is appended in the described business processing error messages;
When its upper strata is called and is returned on the upper-layer service processing units at different levels that call described Service Processing Unit receive described business processing error messages and need, sign with described upper-layer service processing units at different levels appends in the described business processing error messages according to calling order respectively, receives the business processing error messages that includes the Service Processing Unit calling sequence up to request initiating terminal through taking.
2, method according to claim 1 is characterized in that, also comprises:
The described request originating end according to the sign of calling the additional Service Processing Units at different levels of order, carries out location of mistake according to described.
3, method according to claim 1 is characterized in that, the mode by generating call stack is attached to the sign of Service Processing Units at different levels in the described business processing error messages.
4, method according to claim 1 is characterized in that, described Service Processing Unit comprises function or service; The sign of described Service Processing Unit comprises function name or Service name.
5, method according to claim 1 is characterized in that, described Service Processing Unit and the upper-layer service processing units at different levels that call described Service Processing Unit are same in-process or be distributed on a plurality of processes of multiple servers.
6, method according to claim 4 is characterized in that, also comprises:
Analyze described Service Processing Unit calling sequence, identify the Service Processing Unit of far call respectively, and the Service Processing Unit that is called as inner subfunction by last function.
7, a kind of location of mistake servicing unit is characterized in that, comprising:
The sign of makeing mistakes add-on module is used for when Service Processing Unit returns the business processing error messages, and the sign of described Service Processing Unit is appended in the described business processing error messages;
Classification sign add-on module, be used for calling when returning when the upper-layer service processing units at different levels that call described Service Processing Unit receive on described business processing error messages and needs its upper strata, sign with described upper-layer service processing units at different levels appends in the described business processing error messages according to calling order respectively, receives the business processing error messages that includes the Service Processing Unit calling sequence up to client.
8, device according to claim 7 is characterized in that, the mode by generating call stack is attached to the sign of Service Processing Units at different levels in the described business processing error messages.
9, device according to claim 7 is characterized in that, described Service Processing Unit comprises function or service; The sign of described Service Processing Unit comprises function name or Service name.
10, device according to claim 7 is characterized in that, described Service Processing Unit and the upper-layer service processing units at different levels that call described Service Processing Unit are same in-process or be distributed on a plurality of processes of multiple servers.
11, device according to claim 10 is characterized in that, also comprises:
Analysis module is used to analyze described Service Processing Unit calling sequence, identifies the Service Processing Unit of far call respectively, and the Service Processing Unit that is called as inner subfunction by last function.
CN200910165226A 2009-08-13 2009-08-13 Error locating auxiliary method and device Pending CN101620567A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910165226A CN101620567A (en) 2009-08-13 2009-08-13 Error locating auxiliary method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910165226A CN101620567A (en) 2009-08-13 2009-08-13 Error locating auxiliary method and device

Publications (1)

Publication Number Publication Date
CN101620567A true CN101620567A (en) 2010-01-06

Family

ID=41513814

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910165226A Pending CN101620567A (en) 2009-08-13 2009-08-13 Error locating auxiliary method and device

Country Status (1)

Country Link
CN (1) CN101620567A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183620A (en) * 2015-08-07 2015-12-23 北京思特奇信息技术股份有限公司 Method and system for tracking service running state
CN107404456A (en) * 2016-05-18 2017-11-28 阿里巴巴集团控股有限公司 Location of mistake method and device
CN109324925A (en) * 2018-08-29 2019-02-12 北京仁科互动网络技术有限公司 The transaction methods and device of Distributed Architecture
CN109344046A (en) * 2018-08-09 2019-02-15 北京奇艺世纪科技有限公司 A kind of data processing method, device, medium and electronic equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183620A (en) * 2015-08-07 2015-12-23 北京思特奇信息技术股份有限公司 Method and system for tracking service running state
CN107404456A (en) * 2016-05-18 2017-11-28 阿里巴巴集团控股有限公司 Location of mistake method and device
CN109344046A (en) * 2018-08-09 2019-02-15 北京奇艺世纪科技有限公司 A kind of data processing method, device, medium and electronic equipment
CN109344046B (en) * 2018-08-09 2022-01-07 北京奇艺世纪科技有限公司 Data processing method, device, medium and electronic equipment
CN109324925A (en) * 2018-08-29 2019-02-12 北京仁科互动网络技术有限公司 The transaction methods and device of Distributed Architecture

Similar Documents

Publication Publication Date Title
US20180158006A1 (en) Asset data updating
US9239743B2 (en) Method and architecture for exception and event management in an embedded software system
JP5328052B2 (en) RFID discovery, tracking and provisioning of information technology assets
CN101197722A (en) Multi-system error code management method, device and system
CN101371230B (en) Reporting information to a network
CN113254969B (en) Business data processing method and device, electronic equipment and storage medium
CN101192192B (en) Task abnormity diagnosis method and system for real-time operating system
CN101620567A (en) Error locating auxiliary method and device
CN104182683A (en) Method, device and system for monitoring online transactions
US8001424B2 (en) System and method for fault mapping of exceptions across programming models
CN113986669A (en) Call chain tracking and business analysis method based on AOP annotation
CN112486719A (en) Method and equipment for RPC interface call failure processing
CN106412141A (en) Processing method and system for domain name template registration
US7137043B1 (en) Method and system for error handling
CN111562893A (en) Reprinting method and device
CN105739979A (en) Workflow selection method based on probability service process
US20060218155A1 (en) Method and system for using confidence factors in forming a system
CN112948396A (en) Data storage method and device, electronic equipment and storage medium
US20060074764A1 (en) Apparatus and system for monitoring and managing equipment and services
CN114217790A (en) Interface scheduling method and device, electronic equipment and medium
CN101523352A (en) Persistent locks/resources for concurrency control
CN112463338A (en) Accumulation fund service processing method and device, electronic equipment and medium
US9098613B2 (en) Logging of application messages
CN1932760B (en) System and method for execution of application program
CN112818204A (en) Service processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Open date: 20100106