Specific implementation mode
Below in conjunction with the accompanying drawings, the scheme provided this specification is described.
The call relation that the system that this specification provides calls method for detecting abnormality to be suitable between application system carries out
The scene of abnormality detection.Such as, it is carried out abnormality detection suitable for the call relation between application system as shown in Figure 1.Fig. 1
In, each application system can externally provide corresponding application programming interface (Application Programming
Interface, API).Specifically, the call relation between any two application system can be by call corresponding API come
It realizes.
Optionally, it before executing the system that this specification embodiment provides and calling method for detecting abnormality, can first carry out
The determination method (also referred to as training process) of history Frequent tree mining set as shown in Figure 2.This method may include steps of:
Step 210, the corresponding N number of call graph of call relation between N number of moment application system in the past is obtained.
N number of moment herein can be expressed as:T1 ... Tn, N number of call graph can be expressed as:G1,…
Gn.It should be noted that the call graph in this specification can be directed acyclic graph (Directed Acyclic
Graph, DAG).
Assuming that the call relation between application system is as shown in Figure 1, then its corresponding call graph at a certain time in the past
It can be as shown in Figure 3.In Fig. 3, node A-E respectively with the first application system, the second application system, third application system, the 4th
Application system and the 5th application system are corresponding.In one example, Fig. 3 can be expressed as:G={ nodes:[side 1, side
2 ..., side n] } form.It can be expressed as:
G=
A:[B,C]
B:[A,C]
C:[D]
D:[]
A:[B,C]
B:[C]
C:[E]
E:[]
}
Step 220, to each call graph in N number of call graph, according to gSpan subgraph mining algorithms, from tune
At least one subgraph for reaching preset times with occurrence number is excavated in relational graph.
In the present specification, above-mentioned occurrence number is referred to as support (Supp).Correspondingly, above-mentioned preset times
It is properly termed as minimum support (minSupp).In addition, above-mentioned subgraph can refer to a part for full figure (i.e. call graph),
Contain only part of nodes and the side of full figure.
For by taking call graph shown in Fig. 3 as an example, it is assumed that preset times (or minimum support) are 2.According to
GSpan subgraph mining algorithms can excavate to obtain following Result:
Subgraph I1
{
A:[B,C]
B:[C]
C:[]
Support be 2
Subgraph I2
{
A:[B]
B:[]
Support be 2
Subgraph I3
{
A:[C]
C:[]
Support be 2
Subgraph I4
{
B:[C]
C:[]
Support be 2
From the above, it is seen that Result may include:Sub-picture content and support.Wherein, sub-picture content can
To refer to node and side that subgraph is included.
Step 230, history Frequent tree mining is screened from least one subgraph, it is corresponding with the call graph to obtain
History Frequent tree mining.
In one implementation, above-mentioned screening process is specifically as follows:Removal has and is wrapped from least one subgraph
Subgraph containing relationship obtains at least one subgraph to be selected.The target length of at least one subgraph to be selected is calculated, which can
Being determined according to the occurrence number and number of nodes of subgraph to be selected.According to target length, sieved from least one subgraph to be selected
Select history Frequent tree mining.
For by taking call graph shown in Fig. 3 and corresponding history Frequent tree mining (I1, I2, I3 and I4) as an example,
Because I2, I3 and I4 have with I1 by inclusion relation, it is possible to I2, I3 and I4 are removed, so as to only retain I1.
The target length of I1 can be calculated later.In one implementation, the calculation formula of target length can be:M (I1, G)=
DL1 (G | I1)+DL2 (I1), wherein DL1 (G | I1) it is occurrence numbers of the subgraph I1 in full figure G, DL2 (I1) is subgraph I1's
Number of nodes.It in one example, then can be using I1 as the history Frequent tree mining of G if M (I1, G) is less than predetermined threshold value.
Certainly, in practical applications, during screening history Frequent tree mining, removal inclusion relation can also be only carried out
The step of (such as previous example does not calculate the target length of I1, directly using I1 as history Frequent tree mining), or only carry out basis
(such as previous example directly calculates the target length of I1, I2, I3 and I4, then judges that target is long the step of target length is screened
Whether degree screens history Frequent tree mining less than predetermined threshold value), this specification is not construed as limiting this.
Step 240, history Frequent tree mining corresponding with N number of call graph constitutes history Frequent tree mining set.
After filtering out history Frequent tree mining corresponding with each call graph (i.e. G1 ... Gn), so that it may to obtain
Following history Frequent tree mining set:C={ I1 ... Is }, wherein S is the number of history Frequent tree mining.
After getting above-mentioned history Frequent tree mining set, so that it may call method for detecting abnormality to execute following system
(also referred to as predicting process).
Fig. 4 is that the system that this specification one embodiment provides calls method for detecting abnormality flow chart.As shown in figure 4, institute
The method of stating can specifically include:
Step 410, according to the call relation between current time application system, corresponding call graph is generated.
The call graph is referred to shown in Fig. 3, not repeat again herein.
Step 420, according to predefined matching rule, going through in history Frequent tree mining set is obtained from the call graph
The Matching sub-image of history Frequent tree mining.
Herein, predefined matching rule can refer to that the number of nodes between subgraph is mutually same.It is with history Frequent tree mining
For for above-mentioned subgraph I1, the subgraph that can be 3 from the call graph at current time acquisition node number is as above-mentioned
Matching sub-image.
It is understood that when the number of the history Frequent tree mining in history Frequent tree mining set is multiple, it is above-mentioned to obtain
Take the process of Matching sub-image that can carry out successively.In addition, to each history Frequent tree mining, of the Matching sub-image got
Number can be multiple.
Step 430, the target range between history Frequent tree mining and Matching sub-image is calculated.
When the number of Matching sub-image is multiple, the meter of the target range between history Frequent tree mining and each Matching sub-image
Calculation method is similar.Here, for for calculating the target range between a Matching sub-image, which may include
Following steps:
Step A calculates the editing distance between history Frequent tree mining and Matching sub-image.
In one implementation, the volume between history Frequent tree mining and Matching sub-image can be calculated by following formula
Collect distance:∑ [insert (S | I)+delete (S | I)+modify (S | I)], wherein S is Matching sub-image, and I is that history is frequently sub
Figure.Insert (S | I) is by the number of operations that I variations are the insertion operation needed for S, and delete (S | I) is that change I be S institutes
The number of operations of the delete operation needed, modify (S | I) are by number of operations that I variations are modification operation needed for S.It is above-mentioned to insert
It can refers to the operation for node and/or side to enter, delete and change operation.
As an example it is assumed that history Frequent tree mining I is above-mentioned subgraph I1, Matching sub-image S is:
{
A:[B,D]
B:[D]
D:[]
}
I1 is compared with S, it may be determined that I1 variations are needed into 3 modify operations for S.It, can according to above-mentioned formula
It is with the editing distance obtained between I1 and S:Modify (S | I1)=3.
Certainly, in practical applications, the formula of above-mentioned editing distance can also be transformed to other forms, be different behaviour e.g.
The number of operations of work assigns different weighted values, and this specification is not construed as limiting this.
In addition it is also necessary to explanation, this specification can record operation road simultaneously during calculating editing distance
Diameter R.Such as previous example, modify operations changed node or side every time can be sequentially recorded in 3 modify operations.
Step B, the number of nodes for being included according to editing distance, history Frequent tree mining and number of edges calculate target range;Or
Person, the number of nodes for being included according to editing distance, Matching sub-image and number of edges calculate target range.
In one implementation, the calculation formula of target range can be as follows:MatchScore (S | I)=Σ
[insert(S|I)+modify(S|I)+delete(S|I)]/Max(Node_Size(S)+Edge_Size(S),Node_Size
(I)+Edge_Size (I)), wherein MatchScore is target range, and Node_Size is number of nodes, and Edge_Size is side
Number.
It is understood that the target range being calculated by above-mentioned target range calculation formula is between 0 to 1.
It should be noted that in practical applications, the calculation formula of above-mentioned target range can also carry out equivalents
Variation e.g. increases constant or inverted etc., this specification is not construed as limiting this.
Step 440, according to target range, whether identification Matching sub-image is abnormal subgraph.
Herein, can identify whether the Matching sub-image is abnormal according to target range corresponding with each Matching sub-image
Subgraph.
In one implementation, matching threshold Tm can be preset.It should be noted that given enough steps
It suddenly, centainly can be by changing to S from I.Herein, the purpose for setting Tm is above-mentioned change procedure being limited in certain step
It is interior.
After setting Tm, corresponding pre-set interval, e.g., [0, Tm] can be set according to Tm.Specifically, when target range exists
When in [0, Tm] range, which can be identified as to abnormal subgraph.
It is understood that when history Frequent tree mining set includes multiple history Frequent tree minings, above-mentioned steps 420-
Step 440 can repeat.Until recognizing abnormal subgraph or matching corresponding with whole history Frequent tree minings
Figure identification is completed.
Step 450, if it is abnormal subgraph, then according to abnormal subgraph, the calling between current time application system is determined
Exception call relationship in relationship.
Optionally, in order to improve the accuracy of system anomaly detection, this specification when recognizing multiple abnormal subgraphs,
I.e. when the target range between some history Frequent tree mining and corresponding multiple Matching sub-images is in [0, Tm] range, Ke Yicong
Target exception subgraph is chosen in multiple exception subgraphs.Later according to target exception subgraph, determine between current time application system
Call relation in exception call relationship.
In one example, the selection condition of above-mentioned target exception subgraph may include:It is from the variation of history Frequent tree mining
The number of operations of edit operation needed for target exception subgraph is minimum.
It should be noted that may include following several types by the abnormal subgraph that this specification embodiment recognizes:
A, a unexpected node are present in subgraph.
B, a unexpected side are present in subgraph.
C, attribute and the expectation of some node are not inconsistent.
D, attribute and the expectation on some side are not inconsistent.
E, a desired node disappear.
F, a desired side disappear.
It should be noted that after identifying abnormal subgraph, the judgement of following alert if can also be performed:Statistics is worked as
The abnormal subgraph accounting at preceding moment, and count the abnormal subgraph of each historical juncture in preset time period (e.g., 30 minutes) and account for
Than.Abnormal subgraph accounting herein can refer to number and whole subgraphs (including the abnormal subgraph and just of certain moment exception subgraph
The ratio of number Chang Zitu).According to the abnormal subgraph accounting at current time and the abnormal subgraph accounting of each historical juncture,
Calculate abnormal score.In one example, the calculation formula of the exception score can be:Zscore=(x-μ)/σ.Wherein,
Zscore is abnormal score, and x is the abnormal subgraph accounting at current time, and μ is the equal of the abnormal subgraph accounting of each historical juncture
Value, σ are the variance of the abnormal subgraph accounting of each historical juncture.If abnormal score is more than default score value (e.g., 3), then judge full
Sufficient alert if carries out abnormal alarm.
To sum up, the scheme provided by this specification embodiment can not only identify abnormal subgraph, can also obtain exception
Score and abnormal occurrence cause (being determined according to the courses of action R of record), these be all in practical applications to accurately identifying,
The failure that quickly positioning occurs is in demand.
In addition, by the abnormal subgraph in identifying call relational graph, can abnormal carry out accurately and efficiently be called to system
Detection.
Method for detecting abnormality is called with above system accordingly, a kind of system tune that this specification one embodiment also provides
With abnormal detector, as shown in figure 5, the device includes:
Generation unit 501, for according to the call relation between current time application system, generating corresponding call relation
Figure.
Acquiring unit 502, for according to predefined matching rule, the call graph generated from generation unit 501 to obtain
Take the Matching sub-image of the history Frequent tree mining in history Frequent tree mining set;The history Frequent tree mining is according to last time application
What the corresponding call graph of call relation between system determined, which refers to that occurrence number reaches default time
Several subgraphs.
Computing unit 503, for calculating the target between history Frequent tree mining and the Matching sub-image of the acquisition of acquiring unit 502
Distance.
Computing unit 503 specifically can be used for:
The editing distance between history Frequent tree mining and Matching sub-image is calculated, which is according to history is frequently sub
Figure variation is that the number of operations of the edit operation needed for Matching sub-image determines.
The number of nodes and number of edges for being included according to editing distance, history Frequent tree mining calculate target range;Alternatively,
The number of nodes and number of edges for being included according to editing distance, Matching sub-image calculate target range.
Whether recognition unit 504, the target range for being calculated according to computing unit 503, identification Matching sub-image are abnormal
Subgraph.
Recognition unit 504 specifically can be used for:
Judge target range whether in pre-set interval.
If it is, Matching sub-image is identified as abnormal subgraph.
Determination unit 505, according to abnormal subgraph, determines current if being abnormal subgraph for the identification of recognition unit 504
Exception call relationship in call relation between moment application system.
Optionally, acquiring unit 502 is additionally operable to,
Obtain the corresponding N number of call graph of call relation between N number of moment application system in the past.
To each call graph in N number of call graph, according to gSpan subgraph mining algorithms, from call graph
The middle at least one subgraph for excavating occurrence number and reaching preset times.
History Frequent tree mining is screened from least one subgraph;It is frequent to obtain history corresponding with the call graph
Subgraph.
History Frequent tree mining corresponding with N number of call graph constitutes history Frequent tree mining set.
Acquiring unit 502 specifically can be used for:
Removal has by the subgraph of inclusion relation from least one subgraph, obtains at least one subgraph to be selected.
The target length of at least one subgraph to be selected is calculated, target length is the occurrence number and node according to subgraph to be selected
Number determination.
According to target length, history Frequent tree mining is screened from least one subgraph to be selected.
Optionally, which can also include:
Statistic unit 506, the abnormal subgraph accounting for counting current time, and count each within a preset period of time and go through
The abnormal subgraph accounting at history moment.
Computing unit 503 is additionally operable to the abnormal subgraph accounting at the current time counted according to statistic unit 506 and each
The abnormal subgraph accounting of historical juncture calculates abnormal score.
Alarm unit 507 carries out abnormal report if being more than default score value for the abnormal score that computing unit 503 calculates
It is alert.
The function of each function module of this specification above-described embodiment device can pass through each step of above method embodiment
Rapid to realize, therefore, the specific work process for the device that this specification one embodiment provides does not repeat again herein.
The system that this specification one embodiment provides calls abnormal detector, and generation unit 501 is according to current time
Call relation between application system generates corresponding call graph.Acquiring unit 502 according to predefined matching rule,
The Matching sub-image of the history Frequent tree mining in history Frequent tree mining set is obtained from call graph.The calculating of computing unit 503 is gone through
Target range between history Frequent tree mining and Matching sub-image.Recognition unit 504 according to target range, identification Matching sub-image whether be
Abnormal subgraph.If it is abnormal subgraph, it is determined that unit 505 determines between current time application system according to abnormal subgraph
Exception call relationship in call relation.Thus, it is possible to accurately and efficiently call abnormal be detected to system.
Those skilled in the art are it will be appreciated that in said one or multiple examples, described in this specification
Function can be realized with hardware, software, firmware or their arbitrary combination.It when implemented in software, can be by these work(
Can storage in computer-readable medium or as on computer-readable medium one or more instructions or code passed
It is defeated.
Above-described specific implementation mode has carried out into one the purpose, technical solution and advantageous effect of this specification
Step is described in detail, it should be understood that the foregoing is merely the specific implementation mode of this specification, is not used to limit this
The protection domain of specification, all any modifications on the basis of the technical solution of this specification, made, change equivalent replacement
Into etc., it should all be included within the protection domain of this specification.