Summary of the invention
The present invention to solve the above-mentioned problems, proposes a kind of full link application of the cloud platform based on label figure migration side
Figure modeling is marked to micro- application data in method, this method, then according to model carry out full link can the general character determine, generate state
Transfer figure is observed and calculates and execute abnormality detection to the global operating status of full link application using the figure, and positioning is abnormal
Using and application source, and then seek anomaly link subgraph and it be replaced, efficiently accomplish full link application migration.
To achieve the goals above, the present invention adopts the following technical scheme:
A kind of full link application moving method of cloud platform based on label figure, includes the following steps:
Step (1): the micro- of input applies data, builds to micro- label figure for carrying out operating status and dependence using data
Mould, building label graph model;
Step (2): full link is calculated according to the invocation pattern and state parameter applied in label graph model and is applied in reality
Global operating status in operational process;
Step (3): carrying out abnormality detection the global operating status of full link application, if abnormal, execute step (4), no
Then, step (2) are executed;
Step (4): abnormal application source is positioned according to abnormality detection result, seeks anomaly link subgraph and normal link replacement
Subgraph replaces anomaly link subgraph with normal link replacement subgraph, completes full link application migration.
Further, the method for the step 1 specifically:
Step (1-1): it is modeled using data dependence relation:
The mapping relations of building label graph structure model and application data: the node in label graph model indicates to apply, mark
Remember that the side in graph structure model indicates matched using call relation based on application interface parameter;
Step (1-2): global state parameter model is applied:
The mapping relations of building label figure state parameter and application operating status: each node is associated with shape in label graph model
State parameter list records global running state parameter of the node in full link application chain;
Step (1-3): building label graph model: the mapping relations established using step (1-1), step (1-2), building mark
Note figure G=(M, E, L);Wherein, M indicates the set of application, and E indicates that the interface parameters of application matches set, and L indicates the complete of application
Office's running state parameter.
Further, the method for the step 2 specifically:
Step (2-1), judge to apply in full link it is complete can the general character, search from starting point application node msIt is answered to clearing end
With node mtQuan Ketong application in link;
Step (2-2) is successively accessed and is answered from starting point application node to clearing end using BFS (breadth first traversal) algorithm
With the Quan Ketong application in the link of node, the label figure comprising call relation between application and Quan Ketong application can be led to entirely is generated,
It generates from starting point application node msTo clearing end application node mtFull link state shift figure;
Step (2-3) is calculated using aggregate function from starting point application node msTo clearing end application node mtFull link
The full link comprising multiple micro- application nodes in state transition diagram applies the global operating status in actual moving process, institute
The actual observed value that the global operating status value for calculating and obtaining is known as the complete global operating status of link application is stated, is referred to as observed
Value.
Further, the step (2-1) carries out full link passability judgement to application, is determined using counter mechanism
The complete of application can the general character, specially step are as follows:
Step (2-1-1) determines starting point application node msTo clearing end application node mtFull link application;
Step (2-1-2) is each application build counter in full link, sets the initial value of counting as each application
The number of interface input parameter;
Step (2-1-3) determines the interface input parameter of each application in full link: successively inquiry application section
Point msEach interface inputs parameter, if the m inquiredsAn interface input parameter can be by node msForerunner Quan Ketong
It using output, then enables Counter Value subtract 1, inquires msTotal interface input parameter, judge msCounter Value, if it is zero, when
Front nodal point msIt is judged as Quan Ketong node, otherwise msIt is not Quan Ketong node;Full link is successively judged according to the method for this step
In each application it is complete can the general character, until having handled from starting point using msTo clearing end application mtFull link application.
Further, the method that the step (3) executes abnormality detection to the global operating status of full link application are as follows:
The global operating status of full link application is modeled using temporal model, autoregression mould is utilized according to modeling data
Type seeks full link and applies predicted value at the accordingly observation moment, the then distinctiveness ratio of predicted value and observation, if distinctiveness ratio is big
In given threshold, then the complete global operating status of link application is abnormal.
Further, the specific steps of the method that the global operating status of full link application is carried out abnormality detection are as follows:
Step (3-1) applies global operating status time series modeling to full link: by the resulting full link application of step (2)
Global operating status L (mn, j) and in the observation that the preceding n period accordingly observes the moment it is modeled as time series data LT+v L2T+v
..., LnT+v, wherein T is state observation periodicity, and at the time of v is that current period is observed, n is observation wheel
Number, and have 1≤v≤T;
Step (3-2) measures the global operating status distinctiveness ratio of full link application, utilizes i rank according to time series modeling data
Autoregression model seeks the predicted value that the complete global operating status of link application accordingly observes the moment in current (n-th) period
L'nT+v, the complete global operating status of link application is accordingly observed different between the predicted value at moment and observation in current period
Angle value is Q=| LnT+v-L'nT+v|。
Step (3-3), to full link application abnormal test, given threshold λ makes the following judgment: H0:Q>λ,H1:Q<λ;
Wherein λ is the threshold value of setting, if H0It sets up, then detects using abnormal;If H1It sets up, then application is not detected
It is abnormal.
Step (3) method carried out abnormality detection to the global operating status of full link application can be used for full chain
The global operating status of single micro- application in road executes abnormality detection, and detection method is consistent.
Further, the method that abnormal application source is positioned according to abnormality detection result are as follows:
If starting point application node msTo terminal applies node mtEnd-to-end full link application to be detected as full link abnormal
Using then: initialization stack first enables node mtStacking, stack top node mv=mt, and from mvStart backtracking search mvWhole entirely may be used
Logical predecessor node mp;The method detection node m that the global operating status of full link application is carried out abnormality detection using step (3)pEntirely
Whether office's operating status is abnormal: if mpFor exception, then m is enabledpStacking and stack top node updates are mv=mpAnd iteration executes aforementioned behaviour
Make, otherwise mvFor anomaly source application node.
Further, anomaly link subgraph and normal link replacement subgraph are sought, is replaced with normal link replacement subgraph migration
Anomaly link subgraph is changed, the method specific steps of full link application migration are completed are as follows:
It seeks anomaly link subgraph: enabling the anomaly source application node m soughtvImmediate successor node mwFor Quan Ketong node,
It generates from starting point application node msStart through anomaly source application node mvTo its immediate successor application node mwState transition diagram
G';Defining anomaly link subgraph is from starting point application node msStart the transition through abnormal nodes to its immediate successor node to turn
Figure is moved, G' is the anomaly link subgraph sought.The link subgraph is state transition diagram.
The replacement of anomaly link subgraph: m is enabledwFor abnormal source node mvAll immediate successor nodes, from mwIt is applied to starting point
Node msAlong the Quan Ketong predecessor node of state transition diagram recursive backtracking search present node to generate normal link replacement subgraph
G " completes full link application migration with normal link replacement subgraph G " migration replacement anomaly link subgraph.
Further, the method for normal link replacement subgraph G " is generated specifically:
Stack is initialized, successively by abnormal source node mvAll immediate successor nodes be set as present node, grasped as follows
Make: present node m is abnormal source node mvOne of immediate successor node, recursive backtracking search for the complete of present node m can
Logical predecessor node mp, judge whether to meet mp∈ G' enables m if NOpStacking;If so, not stacking;
Judge whether stack top element is ms, if ms, successively accessed using BFS (breadth first traversal) algorithm from starting point
Application node is applied through application node in stack to the Quan Ketong in clearing end application node link, is generated from starting point application node
msStart through stack interior joint to mwNormal link replace subgraph G "=(M ", E ", L ").
A kind of full link application migratory system of cloud platform based on label figure, comprising:
It is micro- to apply data input module, building is modeled to micro- label figure for carrying out operating status and dependence using data
Mark the module of graph model;
The complete global operating status computing module of link application;
The module of abnormality detection is executed to the global operating status of full link application;
The module for positioning abnormal application source seeks the module of anomaly link subgraph and normal link replacement subgraph, will be abnormal
Link subgraph replaces with the transferring module of normal link replacement subgraph.
It is described micro- to be modeled using data input module, to micro- label figure for carrying out operating status and dependence using data
Building marks the module of graph model, the global operating status computing module of full link application, to the global operating status of full link application
The module for executing the module of abnormality detection, positioning abnormal application source, seeks anomaly link subgraph and normal link replaces subgraph
The transferring module that anomaly link subgraph replaces with normal link replacement subgraph is sequentially connected by module.
Compared with prior art, the invention has the benefit that
(1) present invention applies data to micro- by a kind of method of the full link application migration of cloud platform based on label figure
Figure modeling is marked, using model built carry out full link can the general character determine, generate full link state transfer figure, utilize the figure
The global operating status of full link application is observed and predicted value is combined to carry out abnormal state detection, positioning is abnormal to apply and answer
With source, and then seeks anomaly link subgraph and realize full link application ground effective mobility.
(2) method of the invention is proposed based on label figure to micro- application dependence Formal Modeling, theoretically can be more preferable
Ground describes micro- full link property relied on using intrinsic call under cloud distributed structure/architecture.Meanwhile this method passes through on label figure
State transfer search technology can solve the critical issue that the complete global running state information of link application calculates, and overcome traditional " point
To point " local monitor mode the shortcomings that can not feeding back under cloud distributed structure/architecture micro- application and its full link call chain operating status,
It can be realized the abnormality detection to the application of full link and effectively and correctly repair anomaly link, enhance moving for full link application
Shifting ability.
Specific embodiment:
The invention will be further described with embodiment with reference to the accompanying drawing.
It is noted that described further below be all exemplary, it is intended to provide further instruction to the application.Unless another
It indicates, all technical and scientific terms used herein has usual with the application person of an ordinary skill in the technical field
The identical meanings of understanding.
It should be noted that term used herein above is merely to describe specific embodiment, and be not intended to restricted root
According to the illustrative embodiments of the application.As used herein, unless the context clearly indicates otherwise, otherwise singular
Also it is intended to include plural form, additionally, it should be understood that, when in the present specification using term "comprising" and/or " packet
Include " when, indicate existing characteristics, step, operation, device, component and/or their combination.
Relevant technical terms involved in the present invention are illustrated first:
Application of the present invention refers to micro- application.
The complete global operating status of link application: the operating status of all micro- applications is according to cumulative, minimum in full link application
The calculated polymerizing value of the rule such as value or maximum value reflects the overall operation shape that full link application includes all micro- applications
State, such as total response time, the such as total network throughput are complete, and the global operating status of link application is eventually equal in full link application
The global operating status of terminal node.
Link subgraph: utilize BFS (breadth first traversal) algorithm from starting point application node msTo clearing end application node mt
Successively access label figure in Quan Ketong application, it is generated comprising can lead to full application and its call relation directed acyclic graph and
Its subgraph.The directed acyclic graph includes from msTo mtFull link application.
Normal link subgraph: from starting point application node msTo clearing end application node mtThe global operation of full link application
When state is detected as normal, respective links subgraph and its contained any directed acyclic subgraph are normal link subgraph.
Anomaly link subgraph: from starting point application node msTo clearing end application node mtThe global operation of full link application
When state is detected as abnormal, from starting point application node m in respective links subgraphsStarted through anomaly source application node mv
To its immediate successor application node mwThe directed acyclic subgraph of composition is defined as anomaly link subgraph.
The global running state parameter of application: for indicating and recording the global operating status of current application node (as rung
Between seasonable, cpu busy percentage etc.), polymerization can be carried out by step (2-3) to be calculated.
The interface parameters of application matches set: given two are applied maAnd mb, work as maOutput parameter type and mbOne
When input parameter type is identical, claim to apply maInterface parameters with apply mbInterface parameters matching, mark all applications in figure
The collection that interface parameters matching is constituted is collectively referred to as the interface parameters matching set of application.
The complete of node can the general character: given label figure, once from starting point application node msTo clearing end application node mt's
In the search process of full link application, for the arbitrary node m being accessed in figurei, miQuan Ketong is and if only if miInput parameter
All by miThe output of Quan Ketong predecessor node, then miMeet node it is complete can the general character, then miFor Quan Ketong node.It is searching for
Under original state, starting endpoint msIt is defaulted as Quan Ketong node.
Full link state transfer figure: BFS (breadth first traversal) algorithm based on figure is successively accessed from msTo mtScheme in label
In Quan Ketong node, until in figure accessed node include node mtUntil.What final traversal generated only includes Quan Ketong node
Directed acyclic subgraph be from msTo mtFull link state shift figure, which, which reflects full link, applies and called mutually
The process of state propagation and polymerization in journey.
Following embodiments are a kind of typical embodiment of the application, as shown,
Implementation method of the invention is described in detail below with reference to Fig. 1.It is worth noting that, in this flow chart,
The S ∈ Ps, wherein Ps is stack PnormalStack;T < the Tm, wherein Tm is end time Terminal.
A kind of full link application moving method of cloud platform based on label figure, includes the following steps:
Step (1): the micro- of input applies data, builds to micro- label figure for carrying out operating status and dependence using data
Mould, building label graph model;
Step (2): the complete global fortune of link application is calculated according to the invocation pattern and state parameter applied in label graph model
Row state;
Step (3): carrying out abnormality detection the global operating status of full link application, if abnormal, execute step (4), no
Then, step (2) are executed;
Step (4): abnormal application source is positioned according to abnormality detection result, seeks anomaly link subgraph and normal link replacement
Subgraph replaces anomaly link subgraph with normal link replacement subgraph, completes full link application migration.
In embodiments of the present invention, the step (1) inputs micro- using data first, is then marked figure and builds
Mould.The modeling method that figure is marked includes the following steps:
Step (1-1) is modeled using data dependence relation: building label graph structure mode-applies data mapping relations, mark
Note graph model interior joint indicates application, and side indicates matched using call relation based on application interface parameter.
Step (1-2) applies global state parameter model: building label figure state parameter-is closed using operating status mapping
System marks each node in graph model to be associated with a state parameter table, records the overall situation of the node in full link application chain
Running state parameter L.
Step (1-3) building label graph model: the mapping relations established using step (1-1), step (1-2), building mark
Note figure G=(M, E, L).In label figure, node collection M indicates set of applications,
Wherein, k is node mkMark, I and O respectively indicate mkThe input parameter type and output parameter type of corresponding application.Directed edge
Collecting E indicates that application parameter matching set, the set meet:Wherein, muAnd mvIt is respectively
The head node and tail node on side, muThe m for beingvDirect precursor, mvIt is muImmediate successor, muCorresponding application matches mvIt is corresponding to answer
With.ekLabelMeet: (1)(2)In addition, each node is associated in label figure
One global Running Status Table works as prosthomere under conditions of the global operating status of its known predecessor node for particularly pointing out
The global operating status L (m of pointn, j) and to describe with mnUsing the status information of j-th of type of the full link application for terminal.
As shown in Fig. 2, being illustrated using the operating status of response time as j-th of type, it is known that node m1, m2, m3,
m4, m5, m6Response time is respectively 10ms, 15ms, 12ms, 8ms, 16ms and 14ms.Thus each node reality etc. can be calculated
To the response time, wherein t is indicated comprising to apply mnFor the m of terminaln-1The global state information of a application, f expression do not include
To apply mnFor the m of terminaln-1The global state information of a application.With node m6For, it is known that node m3And m5With node m6For
Terminal, because there are four types of situations, i.e. node m for this type j value3、m5Value t, t respectively, t, f, f, t and f, f.It is taken for the first
It is worth situation, node m3With node m5Respectively when value t, t, node m6Response time be 30ms (m6+m5), due to node m3And m5
It is connected in parallel to node m6, therefore only take the longest response time.For second situation, node m3、m5Respectively when value t, f, section
Point m6Response time be 26ms (m3+m6), and so on.
In embodiments of the present invention, described according to built label graph model, to the full link overall operation state of cloud platform
Calculate and includes the following steps:
The full link of step (2-1) can be determined by node: after establishing label figure, give starting point msTo end point mt's
One full link application, need to generate from msTo mtAll related application states can be by node along full link, the state propagated
Transfer figure, with the application of determination full link end to end state shift it is traversed all using invocation pattern.It is called according to application
There are a variety of graph structures such as sequence, convergence, branch in the label figure of Model Establishment, it is different from the definition of the path accessibility of node,
From msTo mtNode m in full link entirely can the general character be defined as the interface parameters of m all by forerunner's Quan Ketong node m of mpIt is defeated
Out, it may be assumed that m.I=mp.O。
Quan Ketong node determination method is as follows: it is assumed that starting endpoint msFor initial Quan Ketong node.From msTo mtSearch
It in the process can the general character using the complete of counter mechanism predicate node.It is each node building counter in calculating, it is initial sets it
Value is the input number of parameters # (m.I) of node.If there is parameter that can be exported by forerunner's Quan Ketong node in search process, meter is enabled
Number device value subtracts one, i.e. # (m.I) --.As Counter Value # (m.I)=0, since all parameters are exported, node m is determined
For Quan Ketong.
The full link state transfer figure of step (2-2) generates: BFS (breadth first traversal) algorithm based on figure successively access from
msTo mtThe Quan Ketong node determined in the step (2-1) in label figure, method particularly includes: 1. accessed node m firsts, and will
Its access flag, which is set to, to be accessed, i.e. visited [msG={ M, E } is schemed in]=1, initialization, wherein M=ms, E is empty set;②
Then vertex m is successively accessedsImmediate successor Quan Ketong nodeThen enableE isUpdate figure G={ M, E };3. and then successively accessingIn immediate successor m
The Quan Ketong node of visited [m]=0, and by 2. middle policy update figure G={ M, E };And so on, until accessing section in figure
Point includes node mtUntil.The only subgraph G comprising Quan Ketong node that final traversal generates is from msTo mtFull link state
Transfer figure.
The complete global operating status of link application of step (2-3) is observed and is calculated: being generated full link state by step (2-2) and is turned
Move Quan Ketong node m in figurenThe global operating status of full link application be defined as from msTo mnQuan Ketong predecessor node current
The global state of the observation operating status value of moment v shifts L (mn,j).Consider a variety of graph structures in full link state transfer figure
(as previously described), the computation rule that can define the global operating status of full link application of correlation graph structure are respectively as follows: L sequence L mergesL bifurcated (mk, j) and=F1
(L(m,j),Qk,j)(1≤k≤n).Wherein, mnFor the Quan Ketong terminal note under corresponding graph structure, j is Status Type label, Qi,j
For the jth class operating status of node i, F1It indicates aggregate function set { ∑, min, ∏, max }.It is specific to calculate, according to from msIt arrives
mnThe full link state transfer figure graph structure integrated use above three formula that includes carry out polymerization full link be calculated answering
With global operating status L (mn,j).In the present invention, the global state of the full link application of j-th of type is defined as L (mt,j).It needs
It is to be noted, that the global operating status of the full link application of the present embodiment is equal to it and terminates end node m according to above-mentioned computation rulet
Global operating status.It can be used as the termination end segment during intermediate search due to individual node any in full link application
Point, step (2-3) can also be used for the calculating of the global operating status of any individual node application in full link.
In embodiments of the present invention, described that abnormality detection is executed to the global operating status of full link application, using timing
Model models the global operating status of full link application in the observation that the preceding n period accordingly observes the moment, according to modeling
Data using autoregression model seek full link and apply accordingly to observe the predicted value at moment in current (n-th) period, then sentence
Disconnected current (n-th) period accordingly observes the distinctiveness ratio of moment predicted value and observation, if distinctiveness ratio is greater than given threshold, full chain
Application global operating status in road is abnormal, the specific steps are as follows:
Step (3-1) applies global operating status time series modeling to full link: by the resulting full link application of step (2)
Global operating status L (mn, j) and in the observation that n period accordingly observes the moment it is modeled as time series data LT+v, L2T+v...,
LnT+v, wherein T is state observation periodicity, and at the time of v is that current period is observed, n is observation wheel number, and has 1≤v
≤T;
The global operating status distinctiveness ratio measurement of the full link application of step (3-2): it is based on the full link application of preceding i periodic knot
Observation L of the observation of global operating status to current periodnT+VIt is predicted, utilizes i rank certainly according to time series modeling data
Regression model obtains predicted value L'nT+v=aiL(n-i)T+v+ai-1L(n-i-1)T+v+......+a2L(n-2)T+v+a1L(n-1)T+v+a0, wherein
a0It is constant term, a1,…,aiIt is model parameter.And then based on the predicted value and sight for measuring the complete global operating status of link application
Different angle value between measured value is Q=| LnT+v-L'nT+v|。
The full link application abnormal test of step (3-3): it is based on it is assumed hereinafter that examining to application execution abnormality detection:
H0:Q>λ,H1:Q<λ;
Wherein λ is the threshold value of setting, if H0It sets up, then detects using abnormal;If H1It sets up, then application is not detected
It is abnormal, and go to step (2-3) and carry out full link state calculating.
In embodiments of the present invention, the step (4) carries out according to testing result using abnormity diagnosis and impact analysis,
Full link application migration scheme is provided to include the following steps:
Step (4-1) anomaly source application positioning, from msTo mtEnd-to-end full link application be detected as full link and answer extremely
With then initialization stack PabnormalStack first, enables node mtStacking, at this time stack top node mv=mt, and from mvStart to recall
Search for its whole Quan Ketong predecessor node mp;Secondly detection mpWhether global operating status is abnormal: if mpFor exception, then m is enabledpEnter
Stack, and stack top node updates are mv=mpAnd iteration executes aforementioned operation, otherwise mvFor anomaly source application node, above-mentioned iteration mistake
Journey terminates.
Step (4-2) seeks anomaly link subgraph, enables the abnormal source node m sought in step (4-1)vImmediate successor be
Quan Ketong node is searched for based on step (2-2), is generated from starting point application node msStart through anomaly source application node mvArrive it
Immediate successor application node mwState transition diagram G';Defining anomaly link subgraph is from starting point application node msStart through different
Figure is shifted in the transition of Chang Jiedian to its immediate successor node, and G' is the anomaly link subgraph sought.The link subgraph is
State transition diagram.
The replacement of step (4-3) anomaly link subgraph, enables mwFor abnormal source node mvAll immediate successor node (direct shadows
Ring node), from mwTo msQuan Ketong predecessor node along state transition diagram recursive backtracking search present node m is to generate replacement
Figure: if recalling the predecessor node m of present node m in search processp∈ G'(anomaly link subgraph), then select other forerunners of m
Node backtracking search;Otherwise, m is enabledpStacking PnormalStack.Work as mp(present node is unmatched in state transition diagram when for sky
Drive node), above-mentioned trace-back process terminates.
Judge whether PnormalStack stack top element is ms, if ms, then new slave m is generated using step (2-1)sIt opens
Begin through PnormalStack stack interior joint to mwNormal link replace subgraph G "=(M ", E ", L "), with replacement from msStart through
Anomaly source mvTo mwAnomaly link subgraph G'=(M', E', L'), i.e., original full link subgraph G=(M, E, L) migration be G ∧=
(M ∧, E ∧, L ∧), wherein M ∧=(M ∪ M' ∪ M ")-(M ∩ M'), E ∧=(E ∪ E' ∪ E ")-(E ∩ E'), L ∧=
L(n+1)T+v.If current time is less than specified end time Terminal, the observation of subsequent time, the sight of the present embodiment setting are carried out
The time interval of survey is 1s, then t=t+1, goes to step (2-3) and executes full link state calculating, executes the monitoring and observation of a new round
And migration.
The foregoing is merely preferred embodiment of the present application, are not intended to limit this application, for the skill of this field
For art personnel, various changes and changes are possible in this application.Within the spirit and principles of this application, made any to repair
Change, equivalent replacement, improvement etc., should be included within the scope of protection of this application.
Above-mentioned, although the foregoing specific embodiments of the present invention is described with reference to the accompanying drawings, not protects model to the present invention
The limitation enclosed, those skilled in the art should understand that, based on the technical solutions of the present invention, those skilled in the art are not
Need to make the creative labor the various modifications or changes that can be made still within protection scope of the present invention.