Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposedBody details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specificThe present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricityThe detailed description of road and method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solution of the present invention, the following is a description of specific embodiments.
Attached drawing 1 is the implementation process schematic diagram for the method that error is called in positioning provided in an embodiment of the present invention, executes masterBody can be terminal or server where being called the system (for example, wechat payment system of Tencent) to malfunction by positioning,For example, a PC or any calculating equipment with server capability etc..The side of error is called in the exemplary positioning of attached drawing 1Method mainly includes the following steps that S101 to S103, described further below:
S101 is obtained and the matched service request number of preset keyword, wherein service request unique identification single businessAll modules that single service request is related to are requested and correspond to call.
So-called preset keyword is that tester is arranged some relevant to the bit-errors undetermined to position mistakeThe keyword of information, these settings is also the letter for including in debugging log (log generated when debugging log is debugging routine)Breath.For example, the module call error occurred during in order to position the shopping that places an order on primary line, payment, tester can be withThe module call error occurred during positioning place an order on primary line shopping, payment as preset keyword using order number.It needsIt is noted that preset keyword can be with more than one, for example, preset keyword can also be UIN and trading company in above-mentioned exampleDeng.
In embodiments of the present invention, service request unique identification single service request and correspond to single service request relate toAnd all modules call, the content of service request number includes that module calls the mark of involved module, 16 system IP, sample stageNot, the information such as timestamp, port numbers and serial number, and module calling each time can all print the service request in debugging logNumber, therefore, as long as in debugging log including preset keyword, it can be matched to debugging log according to preset keyword,To get and the matched service request number of preset keyword.
It should be noted that debugging log can store in log database, can according to the service request of initiation, toLog database stores debugging log.Specifically, according to the service request of initiation, can lead to log database storage debugging logCross following steps S1011 to S1013 realization:
S1011 acquires debugging log according to the service request of initiation.
As long as can be related to module calling as previously mentioned, there is service request, and module calling can correspondingly generate debuggingLog, therefore debugging log can be acquired according to the service request of initiation.
S1012 caches the debugging log acquired through step S1011.
Since there are many debugging log, collected in embodiments of the present invention to mitigate the storage pressure of log databaseDebugging log be not log database to be written at once, but be cached.
S1013, periodically to the debugging log of log database batch write-in caching.
The period that debugging log is written to log database batch can be determined according to actual scene, for example, if bandwidthMachine performance itself where smaller or log database is not high, can will determine in the period it is larger, for example, it may be with 3 secondsFor the period, conversely, can will then determine in the period it is smaller, such as with 1 second for the period, by the period be 1 second or 3 seconds caching whenBetween, to the debugging log of log database batch write-in caching.
S102 obtains all debugging days corresponding with service request number according to the service request number obtained through step S101Will.
If the service request number called with the secondary module will necessarily be generated as previously mentioned, being related to module calling, andIt can print in debugging log, therefore, as long as getting a service request number, can get and the service request numberCorresponding all debugging logs.
It should be noted that since preset keyword does not appear in all debugging for having printed some service request numberIt is that can not be matched to all debugging logs for having printed some service request number only according to preset keyword therefore in log's.For example, certain preset keyword K is contained in debugging log L1, L2And L5, it is assumed that debugging log L1、L2And L5It is in module M1It adjustsWith module M2Shi Shengcheng, meanwhile, this module is called generates service request SeqN again1, on the other hand, it is also possible to due to mouldBlock M3Calling module M5When also create service request SeqN1And have printed debugging log L3、L4And L6, but debugging log L3、L4And L6In and do not include preset keyword K debugging log L therefore can not be got according to preset keyword K3、L4And L6.ByDebugging log L is contained in preset keyword K1、L2And L5In, and be in module M1Calling module M2Shi Shengcheng and module are calledGenerate service request SeqN1, therefore, available to arrive service request SeqN according to preset keyword K1, and in moduleM3Calling module M5When generate service request SeqN1And have printed debugging log L3、L4And L6, therefore, according to service requestNumber SeqN1, just got and service request SeqN1Corresponding all debugging logs, i.e. debugging log L1、L2、L3、L4、L5And L6。
S103 generates the module comprising error code prompt and calls according to all debugging logs corresponding with service request numberRelational graph.
As one embodiment of the invention, according to all debugging logs corresponding with service request number, generating includes mistakeThe module call graph of code prompt S1031 to S1033 can be realized as follows:
S1031, according to the sequencing that module in debugging log is called, generation module call graph.
The sequencing that so-called module is called can be the relationship that module is called with is called, for example, modules A calls mouldModule B can be then placed on the right of modules A by block B from left to right, if modules A calling module B and module C, and module B andModule C does not have call relation, then module B and module C can be placed on to the right of modules A, and module B and module C are arranged side by side,If attached drawing 2-a is the module call graph that the embodiment of the present invention generates, each of each module composition module call graphModule nodes.
S1032, by each Module nodes enter ginseng and out Shenfu is added in module call graph to constitute each moduleNode enters to join node and out ginseng node.
For example, the node that enters to join of each Module nodes is marked using " in " in the exemplary module call graph of attached drawing 2-aNote, and the ginseng node that goes out of each Module nodes is marked using " out ".
S1033 goes out parameter according to analyzing, if wrong code, to first to the logs of all Module nodesThe Module nodes of error are identified.
In embodiments of the present invention, going out at ginseng node for the Module nodes that can be malfunctioned at first uses special color, exampleIf red or black identifies it, so that the Module nodes accordingly to malfunction are identified, for example, logos go out in attached drawing 2-bGinseng node shows that error code occurs in corresponding Module nodes F.
For there are the Module nodes of error code, its error message can be shown, that is, receiving open instructionsAfterwards, the error message of the Module nodes of error is shown.For example, Module nodes F can be clicked for the Module nodes F of attached drawing 2-bOr it goes out to join node, the then error message of display module node F.
Below by taking the wechat payment system of Tencent (or mobile phone QQ payment system) as an example, the present invention is further explainedTechnical solution.Wechat payment system mainly includes external calling interface, protocol conversion module and some intermediate service modulesDeng, wherein external calling interface is that the entrance of a business can be called in wechat payment system by external calling interfaceVarious services (service), complete payment transaction logical process, and protocol conversion module completes external calling interface and intermediary serviceProtocol conversion between module, it is possible to provide the routing of a variety of machinery equipments, intermediate service module provide certain business logic processings,Externally the service interface that calls for wechat payment system is provided individually to service (service), and an intermediate service moduleMultiple service interfaces may be present, and allow service call service.
It is the hardware implementing architecture figure for the method that error is called in positioning provided in an embodiment of the present invention as shown in attached drawing 9-a,Wherein, marked as 901 it is mobile terminal, is connect by network with the server marked as 902, run on server 902The program of the method for error is called in positioning, and server 902 is also to be positioned to call the system of error (for example, Tencent is micro-Believe payment system) where server, installation log capture program and log buffer program etc. thereon, what it is marked as 903 is dayWill database (Data Base, DB) is mainly used for storing debugging log.
User's (main specific bit calls out wrong tester or research staff herein) is by mobile terminal 901 to externalCalling interface initiates a service request, wherein including preset keyword.Since service request unique identification single business is askedIt seeks and corresponds to all modules that single service request is related to call, the content of service request number includes that module calls involved mouldThe information such as the mark of block, 16 system IP, sampling rank, timestamp, port numbers and serial number, and call all can be for module each timeThe service request number is printed in debugging log, it therefore, can be according to preset keyword after server 902 receives the service requestIt is matched to debugging log, to get and the matched service request number of preset keyword.
It should be noted that the above-mentioned debugging log referred to is stored in log database 903.Server 902 can basisService request from mobile terminal 901 stores debugging log to log database 903, and specific method is in server 902The service request that log collection program is initiated according to mobile terminal 901 acquires debugging log, and in order to mitigate log databaseThe debugging log of log collection programmed acquisition is cached by 903 storage pressure, the log buffer program in server 902,Then, these debugging logs cached are periodically written in batches to log database 903.
After server 902 gets service request number, it can be obtained according to the service request number of acquisition from log database 903Take all debugging logs corresponding with service request number.Debugging log is the basis of 902 generation module call graph of serverMaterial, that is, server 902 can generate the mould comprising error code prompt according to all debugging logs corresponding with service request numberBlock call graph, the specific method is as follows S1 to S3:
S1, the sequencing that server 902 is called according to module in debugging log, generation module call graph.
As previously mentioned, wechat payment system includes external calling interface, protocol conversion module and multiple intermediate service modules,There is the sequencing called in protocol conversion module and intermediate service module, also there is the successive of calling between intermediate service moduleSequentially.For example, protocol conversion module R intermediate service module M1, then can be placed on agreement by intermediate service module M1 from left to rightThe right of conversion module R, if intermediate service module M1 calling intermediate service module M2 and intermediate service module M3, and intermediary serviceModule M2 and intermediate service module M3 do not have call relation, then can all put intermediate service module M2 and intermediate service module M3It sets on the right of intermediate service module M1, intermediate service module M2 and intermediate service module M3 are arranged side by side, further, if intermediate clothesBe engaged in module M3 calling intermediate service module M4, then intermediate service module M4 can be placed on to the right of intermediate service module M3.It needsIt is noted that the module call graph generated through step S1, each module of each module composition module call graphNode.
S2, server 902 by each Module nodes enter ginseng and out Shenfu be added in module call graph it is every to constituteA Module nodes enter to join node and out ginseng node.
In the module call graph generated through step S1, the node that enters to join of each Module nodes is marked using " in ", andThe ginseng node that goes out of each Module nodes is marked using " out ".
S3, server 902 go out parameter according to analyzing, if wrong code, right to the logs of all Module nodesThe Module nodes of first error are identified.
For example, server 902 to the logs of all Module nodes go out parameter according to analyzing after, can malfunction at firstModule nodes go out at ginseng node to use the special color, such as red or black identify to it.For there is error codeModule nodes can be shown its error message, that is, be referred to through user by the opening that mobile terminal 901 is sent receivingAfter order, server 902 shows the error message of the Module nodes of error.
It should be noted that mobile terminal 901 can also be by based on personal computer terminal in the architecture diagram of attached drawing 9-aAutomatic test platform replace, as shown in attached drawing 9-b, be another embodiment of the present invention provides positioning call error methodHardware implementing architecture figure, what it is marked as 904 is the personal computer terminal for running automatic test platform.
It should also be noted that the framework of either attached drawing 9-a or attached drawing 9-b, log database 903 be can integrate in clothesBe engaged in device 902, as shown in attached drawing 9-c and attached drawing 9-c another embodiment of the present invention provides positioning call error method hardwareIt realizes in architecture diagram, log database 905 or 906 is integrated in server 902.
Call the method for error it is found that due to that can match according to preset keyword from the exemplary positioning of above-mentioned attached drawing 1Service request number, ultimately generate comprising error code prompt module call graph, and module call graph can to go outThe Module nodes of existing error code are identified, and therefore, are carried out blog search only according to log system with the prior art, are neededManually further gradually investigation come orientation problem compare, technical solution provided by the invention is directly identified comprising error codeModule nodes improve the efficiency that error is called in positioning to save the human cost of tester.
Fig. 3 is the schematic diagram for the device that error is called in positioning provided in an embodiment of the present invention.Book for ease of description only showsPart related to the present invention is gone out.It mainly includes the first acquisition module 301, that the device of error is called in the exemplary positioning of Fig. 3Two obtain module 302 and generation module 303, and detailed description are as follows:
First obtains module 301, for obtaining and the matched service request number of preset keyword, wherein service request numberUnique identification single service request simultaneously corresponds to all modules calling that single service request is related to;
Second obtains module 302, for obtaining all debugging days corresponding with service request number according to service request numberWill;
Generation module 303, for generating and being prompted comprising error code according to all debugging logs corresponding with service request numberModule call graph.
It should be noted that device provided in an embodiment of the present invention, due to being based on same structure with embodiment of the present invention methodThink, bring technical effect is identical as embodiment of the present invention method, and particular content can be found in embodiment of the present invention methodNarration, details are not described herein again.
The exemplary generation module 303 of attached drawing 3 may include that mould tune relationship generation unit 401, extra cell 402 and mark are singleMember 402, as the device of error is called in the exemplary positioning of attached drawing 4, in which:
Mould tune relationship generation unit 401, the sequencing for being called according to module in debugging log, generation module callRelational graph;
Extra cell 402, for by each Module nodes enter ginseng and out Shenfu is added in module call graph with structureEnter to join node and out ginseng node at each Module nodes;
Identify unit 403, for the log to all Module nodes go out parameter according to analyzing, if wrong code,The Module nodes then to malfunction to first are identified.
The exemplary device of attached drawing 4 can also include display module 501, as the device of error is called in the exemplary positioning of attached drawing 5.Display module 501 is used for after receiving open instructions, shows the error message of the Module nodes of first error.
It to include memory module 601 that the device of error is called in the positioning of attached drawing 3 to 5 any example of attached drawing, such as attached drawing6-a calls the device of error to the positioning of attached drawing 6-c any example.Memory module 601 is used for the service request according to initiation, toLog database stores debugging log.
The memory module 601 of attached drawing 6-a to attached drawing 6-c any example may include acquisition unit 701, cache unit 702The device of error is called with writing unit 703, such as positioning of attached drawing 7-a to attached drawing 7-c any example, in which:
Acquisition unit 701 acquires debugging log for the service request according to initiation;
Cache unit 702 is used for multistage pipeline log;
Writing unit 703, for periodically to the debugging log of log database batch write-in caching.
Fig. 8 is the structural schematic diagram for the calculating equipment that one embodiment of the invention provides.As shown in figure 8, the meter of the embodimentEquipment 8 is calculated to specifically include that processor 80, memory 81 and be stored in the meter that can be run in memory 81 and on processor 80The program of the method for error is called in calculation machine program 82, such as positioning.It is above-mentioned fixed that processor 80 is realized when executing computer program 82Call the step in the embodiment of the method for error, such as step S101 to S103 shown in FIG. 1 in position.Alternatively, processor 80 executesThe function of each module/unit in above-mentioned each Installation practice is realized when computer program 82, such as the first acquisition module shown in Fig. 3301, the function of the second acquisition module 302 and generation module 303.
Illustratively, positioning calls the computer program 82 of the method for error to specifically include that acquisition and preset keywordThe service request number matched, wherein service request unique identification single service request simultaneously corresponds to what single service request was related toAll modules are called;According to service request number, all debugging logs corresponding with service request number are obtained;According to service requestNumber corresponding all debugging logs generate the module call graph comprising error code prompt.Computer program 82 can be dividedOne or more module/units are cut into, one or more module/unit is stored in memory 81, and by processor 80It executes, to complete the present invention.One or more module/units can be the series of computation machine program that can complete specific functionInstruction segment, the instruction segment are used to describe computer program 82 and are calculating the implementation procedure in equipment 8.For example, computer program 82Function (the mould in virtual bench of user's screening module 201, characteristic extracting module 202 and output module 203 can be divided intoBlock), each module concrete function is as follows: first obtains module 301, is used for acquisition and the matched service request number of preset keyword,Wherein, service request unique identification single service request and all modules calling being related to corresponding to single service request;TheTwo obtain module 302, for obtaining all debugging logs corresponding with service request number according to service request number;Generation module303, for generating the module call relation comprising error code prompt according to all debugging logs corresponding with service request numberFigure.
Calculating equipment 8 may include, but are not limited to processor 80, memory 81.It will be understood by those skilled in the art that Fig. 8The example for only calculating equipment 8, does not constitute the restriction to equipment 8 is calculated, and may include than illustrating more or fewer portionsPart perhaps combines certain components or different components, such as calculating equipment can also connect including input-output equipment, networkEnter equipment, bus etc..
Alleged processor 80 can be central processing unit (Central Processing Unit, CPU), can also beOther general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processorDeng.
Memory 81 can be the internal storage unit for calculating equipment 8, such as calculate the hard disk or memory of equipment 8.StorageDevice 81 is also possible to calculate the External memory equipment of equipment 8, such as calculates the plug-in type hard disk being equipped in equipment 8, intelligent storageBlock (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Further, memory 81 can also both include calculating the internal storage unit of equipment 8 or including External memory equipment.Memory81 for other programs and data needed for storing computer program and calculating equipment.Memory 81 can be also used for temporarilyStore the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each functionCan unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by differentFunctional unit, module are completed, i.e., the internal structure of device are divided into different functional unit or module, to complete above descriptionAll or part of function.Each functional unit in embodiment, module can integrate in one processing unit, be also possible toEach unit physically exists alone, and can also be integrated in one unit with two or more units, above-mentioned integrated unitBoth it can take the form of hardware realization, can also realize in the form of software functional units.In addition, each functional unit, mouldThe specific name of block is also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.It is single in above systemMember, the specific work process of module, can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodimentThe part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosureMember and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actuallyIt is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technicianEach specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceedThe scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/calculating device and method, it can be withIt realizes by another way.For example, device described above/calculating apparatus embodiments are only schematical, for example, mouldThe division of block or unit, only a kind of logical function partition, there may be another division manner in actual implementation, such as multipleUnit or assembly can be combined or can be integrated into another system, or some features can be ignored or not executed.It is anotherPoint, shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, device orThe INDIRECT COUPLING or communication connection of unit can be electrical property, mechanical or other forms.
Unit may or may not be physically separated as illustrated by the separation member, shown as a unitComponent may or may not be physical unit, it can and it is in one place, or may be distributed over multiple networksOn unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unitIt is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated listMember both can take the form of hardware realization, can also realize in the form of software functional units.
If integrated module/unit is realized in the form of SFU software functional unit and sells or use as independent productWhen, it can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-described embodiment sideAll or part of the process in method can also instruct relevant hardware to complete by computer program, and error is called in positioningThe computer program of method can be stored in a computer readable storage medium, which is being executed by processorWhen, it can be achieved that the step of above-mentioned each embodiment of the method, that is, obtain and the matched service request number of preset keyword, wherein industryBusiness request unique identification single service request simultaneously corresponds to all modules calling that single service request is related to;It is asked according to businessThe number of asking obtains all debugging logs corresponding with service request number;It is raw according to all debugging logs corresponding with service request numberAt the module call graph prompted comprising error code.Wherein, computer program includes computer program code, computer programCode can be source code form, object identification code form, executable file or certain intermediate forms etc..Computer-readable medium canTo include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, light that can carry computer program codeDisk, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that computer-readableThe content that medium includes can carry out increase and decrease appropriate according to the requirement made laws in jurisdiction with patent practice, such as at certainA little jurisdictions do not include electric carrier signal and telecommunication signal according to legislation and patent practice, computer-readable medium.More thanEmbodiment is merely illustrative of the technical solution of the present invention, rather than its limitations;Although being carried out with reference to the foregoing embodiments to the present inventionDetailed description, those skilled in the art should understand that: it still can be to skill documented by foregoing embodimentsArt scheme is modified or equivalent replacement of some of the technical features;And these are modified or replaceed, and do not make phaseIt answers the essence of technical solution to depart from the spirit and scope of the technical scheme of various embodiments of the present invention, should be included in protection of the inventionWithin the scope of.