Embodiment
For making object of the present invention, technical scheme and advantage clearly understand, below by specific embodiment and relevant drawings, the present invention will be described in further detail.
Embodiment one
The embodiment of the present invention one provides a kind of rule base upgrading method, for also detecting message in escalation process, thus can not cause the interruption of business.
See Fig. 1, the embodiment of the present invention comprises the steps:
S101, reception rule base upgrade command;
S102, according to described upgrade command, new regulation storehouse is loaded into memory cell;
Before this step, whether the capacity that first can also detect memory cell is enough, if so, new regulation storehouse is loaded into memory cell; If not, then do not upgrade.
S103, stopping matching unit using old rule base to mate new stream;
Here matching unit refers to and carries out for the message in convection current the unit that mates, new stream come after referring to and having loaded new regulation storehouse not through the stream of overmatching, in the embodiment of the present invention, matching unit stops using old rule base to mate to new stream.
S104, before described matching unit uses described new regulation storehouse to mate new stream completely, described matching unit uses old rule base to mate the old stream do not stopped.
Step 104 is different according to matching unit and rule base corresponding relation, can have different implementations:
When matching unit and rule base are static binding (certain matching unit is fixing corresponds to certain rule base), matching unit first can be waited until and use the old stream of old rule base coupling to stop, and enable matching unit uses new regulation storehouse to mate new stream completely more afterwards.
Because matching unit in system generally all can have multiple, therefore can be dispatched these matching units by a dispatching algorithm, as scheduling coupling can be carried out by Round-Robin (polling dispatching) mode, now, if will upgrade to one of them matching unit, then first it is forbidden (such as, forbidding from RR scheduling process) from the process of scheduling; Then wait until and use the stream of old rule base coupling to stop; Enable matching unit again, uses new regulation storehouse to mate new stream completely.When have multiple need upgrading to be new regulation storehouse time, each matching unit is upgraded successively.
When matching unit is dynamic binding with rule base (rule base that certain matching unit is corresponding is not fixed), matching unit does not need the old stream by the time using old rule base to mate to stop, just use new regulation storehouse to mate new stream completely, but new regulation storehouse can be used immediately to mate new stream.Now, matching unit also exists corresponding relation with new and old rule base respectively, namely for the old stream do not stopped, uses old rule base to mate; For new stream, new regulation storehouse is used to mate.After the old stream mated when by the time using old rule base stops, new regulation storehouse is just used to mate new stream completely.
When matching unit and rule base are dynamic binding, if when having multiple matching unit to need to upgrade, do not need to upgrade successively to each matching unit, if namely do not need to bring into use new regulation storehouse to carry out coupling to another matching unit again after certain matching unit uses new regulation storehouse to mate completely by the time to flow through when having in escalation process at certain matching unit, then can dispatch and select other matching units to use, if other unit have been upgraded complete, new rule base is then used to mate, if it is complete also not upgrade, old rule base is then used to mate.
No matter which kind of binding pattern matching unit and rule base adopt, and when not having matching unit to use old rule base to mate old stream, delete old rule base.
Here it should be noted that, in loading new regulation storehouse in the process of memory cell, can not original old rule base be covered.
During the upgrading of embodiment of the present invention rule base, before matching unit uses new regulation storehouse to mate new stream completely, still old rule base is used to mate to the old stream do not stopped, thus no matter can carry out detection for new stream and old stream, therefore, the interruption of business can not be caused, improve the reliability of system.
Embodiment two
Embodiments provide a kind of rule base upgrading method, for also detecting message in escalation process, thus the interruption of business can not be caused.
See Fig. 2, in the embodiment of the present invention, matching unit and rule base are the relation of static binding, namely each matching unit is corresponding with a rule base, and such as, matching unit 0 and matching unit 1 correspond to rule base 0, matching unit 2 corresponds to rule base 1, and matching unit n corresponds to rule base n.
Here matching unit can be understood as the unit module that can complete and mate the characteristic information in message, during specific implementation, thread when can be processor process, or adopt core during polycaryon processor, or there is the processor of independent process function, or other hardware processing element, its specific implementation does not limit.
Rule base is arranged in memory cell, and the memories such as such as DDR, SDRAM, Flash, meanwhile, each rule base can be arranged in same memory, also can lay respectively at multiple memory, does not also limit at this.
In order to be described rule base escalation process better, only have one for old rule base below, escalation process is described.
See Fig. 3, matching unit comprises matching unit 0 to matching unit n many matching units; Rule base 0 is positioned at memory cell for old rule base, supposes that its memory address is 0x1111 to 0x2222, each matching unit and rule base 0 static binding.Below the rule base upgrade step based on this application is described in detail, see Fig. 4, comprises the steps:
S201, reception rule base upgrade command;
S202, according to upgrade command, new regulation storehouse is loaded into memory cell;
See Fig. 3, suppose that rule base 1 is new regulation storehouse, be then loaded into memory cell by rule base 1 here; It should be noted that, new regulation storehouse can not cover old rule base in memory cell, otherwise can cause the loss of old rule base data.Such as, rule base 1 is loaded into the memory space that memory address is 0x3333 to 0x5555 here.
S203, will need upgrading matching unit forbid from the process be scheduled;
Dispatching algorithm does not limit at this, as RR dispatching algorithm or other algorithms can be used, if certain matching unit needs upgrading (namely using the convection current of new regulation storehouse to mate), then first it is forbidden from the process be scheduled, make it not re-use old rule base and new stream is mated.
S204, this matching unit use old rule base to mate the old stream do not stopped;
In order to not stop coupling to old stream, the embodiment of the present invention still uses old rule base to mate for the old stream do not stopped.
S205, when old stream stops, this matching unit uses new regulation storehouse to mate new stream, and meanwhile, this matching unit enable can be dispatched again;
Judge whether old stream stops, can be judged by the stream number detected in matching unit, if flowing number in certain matching unit is not 0, then the stream also also existing in this matching unit and do not stop is described; Otherwise when certain stream in matching unit stops, stream number can subtract 1; When all stream all stops, stream number becomes 0, thus can judge that old stream stops.
If flow through when having in escalation process at certain matching unit, then can dispatch and select other matching units to use, if other unit have been upgraded complete, then use new rule base to mate, if it is complete also not upgrade, then old rule base is used to mate.
If when having multiple matching unit to need to upgrade, then according to the flow of stream, the part in multiple described matching unit is first upgraded, like this, when follow-up have flow through come time, other matching units of not upgrading can be allowed to mate, prevent when newly flowing through, the situation that all matching units all cannot mate current new stream of coming in upgrading.Matching unit number of this part upgrading can do suitably scheduling according to the size of flow, such as, have 10 matching units, when flow is large, can only allow wherein 1 or 2 while first upgrade, follow-uply select 1 or 2 to upgrade again; And when flow hour, can first by wherein 3 or 4 while first upgrade, follow-uply select suitable matching unit to upgrade again.
When not having matching unit to use described old rule base to mate old stream, delete old rule base.
It should be noted that, when reporting matching result, need to specify to use which rule base, make subsequent treatment module perform different strategies according to the specific rules in Different Rule storehouse.
Matching unit after upgrading and rule base schematic diagram can see Fig. 5, as shown in Figure 5, matching unit 0 mates with new regulation storehouse (rule base 1) after upgrading, and all the other matching units of not upgrading still use old rule base (rule base 0) to mate.
Stream in the embodiment of the present invention specifically can be shown to manage by stream, and which matching unit stream table, for preserving the relevant information of stream, after receiving a stream, can use mate by looking into stream table to determine; If stream table does not exist, then need to create stream table by being scheduling to this flow assignment matching unit.
See Fig. 6, be the schematic flow sheet that the embodiment of the present invention is mated a certain matching unit by stream table implementation, comprise:
S211, reception message;
S212, look into stream table judge whether hit; If hit, perform step S213, otherwise, perform step S215;
S213, stream table exist, and use old rule base to mate message;
If search the hit of stream table, then illustrate that the stream that this message is corresponding has had corresponding stream table, therefore, use old rule base to mate message;
S214, submission matching unit mate;
S215, judge whether matching unit has upgraded; If so, perform step S216, if not, perform step S218;
When flowing table and being miss, illustrate that the stream come is new stream, therefore, need to judge whether matching unit has upgraded;
S216, establishment stream table, and matching unit is selected in scheduling;
If matching unit has been upgraded (namely matching unit uses new regulation storehouse to mate new stream completely), be then that this new stream creates stream table, and matching unit (as used RR mode) is selected in scheduling;
The number of S217, matching unit adds 1;
Owing to there being new stream, therefore, 1 is added to the stream number of matching unit;
S218, establishment stream table, and other matching units are selected in scheduling;
When matching unit is not upgraded, then first create stream table, then scheduling selects other matching unit convection current to mate; If other matching unit completes upgrading, then new rule base can be used to mate; If do not complete upgrading, then old rule base can be used to mate
If flow through when having in escalation process at certain matching unit, then can dispatch and select other matching units to use, if other unit have been upgraded complete, then use new rule base to mate, if it is complete also not upgrade, then old rule base is used to mate.
Here also it should be noted that, above-mentioned rule base upgrading method can run on the equipment that DPI equipment or other need use similar rule storehouse.
During the upgrading of embodiment of the present invention rule base, before matching unit uses new regulation storehouse to mate new stream completely, still old rule base is used to mate to the old stream do not stopped, thus no matter can carry out detection for new stream and old stream, therefore, the interruption of business can not be caused, avoid the leakage identification of agreement in escalation process, improve the reliability of system.
Embodiment three
Embodiments provide a kind of rule base upgrading method, for also detecting message in escalation process, thus the interruption of business can not be caused.
In the embodiment of the present invention, matching unit and rule base adopt the mode of dynamic binding, and namely do not determine the corresponding relation in matching unit Sum fanction storehouse in advance, when there being message, dispatching algorithm selects one of them matching unit to mate;
When adopt dynamic binding mode time, matching unit does not need the old stream by the time using old rule base to mate to stop, new regulation storehouse is just used to mate new stream completely, but new regulation storehouse can be used immediately to mate new stream, but the old stream do not stopped still mates with old rule base.Now, matching unit also exists corresponding relation with new and old rule base respectively, that is: for the old stream do not stopped, use old rule base to mate; For new stream, new regulation storehouse is used to mate.After the old stream mated when by the time using old rule base stops, new regulation storehouse is just used to mate new stream completely.
See Fig. 7, for the embodiment of the present invention carries out the method flow diagram of rule base upgrading, comprise the steps:
S301, reception message;
Whether S302, judgement are looked into stream table and are hit; If perform step S303, if not, step S305 is performed;
S303, stream table exist, and this message mates old rule base;
If there has been stream table, then illustrates it is old stream, used old rule base to mate;
S304, submission matching unit mate;
S305, stream table do not exist, and create stream table, mate new rule base;
When stream table does not exist, then what come is new stream, needs to create new stream table, and uses new rule base to mate;
S306, the stream number of matching unit of mating this stream add 1; Follow-up execution step S304.
When have newly flow time, the stream number in matching unit is added 1.
When matching unit and rule base are dynamic binding, also each matching unit can flow with new regulation storehouse coupling is new because both can mate old stream with old rule base, if so when having multiple matching unit to need to upgrade, do not need first to upgrade to a part of matching unit, can simultaneously to needing the matching unit of upgrading to upgrade.
When not having matching unit to use old rule base to mate old stream, delete old rule base.
During the upgrading of embodiment of the present invention rule base, before matching unit uses new regulation storehouse to mate new stream completely, still old rule base is used to mate to the old stream do not stopped, thus no matter can carry out detection for new stream and old stream, therefore, the interruption of business can not be caused, improve the reliability of system.
Embodiment four
Embodiments provide a kind of communication equipment, for also detecting message in escalation process, thus the interruption of business can not be caused.
See Fig. 8, a kind of communication equipment of the embodiment of the present invention comprises:
Receiving element 401, for receiving the stream of rule base upgrade command and needs coupling;
Memory cell 403, for storage rule storehouse;
Rule base administrative unit 402, is loaded into described memory cell for the described upgrade command received according to described receiving element by new regulation storehouse;
At least one matching unit 404, for after new regulation storehouse is loaded into memory cell by described rule base administrative unit, stops using old rule base to mate new stream;
Before described matching unit uses described new regulation storehouse to mate new stream completely, described matching unit uses old rule base to mate the old stream do not stopped.
Wherein, different according to from rule base binding relationship of matching unit, can adopt different upgrade methods:
When matching unit and rule base adopt the relation of static binding, described matching unit is forbidden from (as RR scheduling mode) the process be scheduled; When the old stream that described matching unit uses old rule base to carry out mating stops, enable described matching unit can be scheduled, and uses new regulation storehouse to mate new stream completely.
When there being multiple matching unit to need upgrading, the flow according to stream is first upgraded to the part in multiple described matching unit.
When matching unit and rule base adopt the relation of dynamic binding, described matching unit uses described old rule base to mate the old stream do not stopped, use described new regulation storehouse to mate new stream simultaneously, when old stream stops, use new regulation storehouse to mate new stream completely.
Because under dynamic binding pattern, matching unit both can process old stream, also can flow with new regulation storehouse coupling is new, therefore, when there being multiple matching unit to need upgrading, can upgrade to described matching unit simultaneously, referring to if there is multiple matching unit to receive upgrade command here, then can wait until that the upgrading of a part of matching unit is complete afterwards to upgrade again, but can directly upgrade.
Described rule base administrative unit also for:
When not having matching unit to use old rule base to mate old stream, delete old rule base.
Here it should be noted that, after receiving upgrade command, whether the capacity that rule base administrative unit first can also detect described memory cell is enough, if so, then new regulation storehouse is loaded into memory cell; If not, can not loading upgrading be carried out.In the middle of the process loading new regulation storehouse, old rule base can not cover by new regulation storehouse, otherwise can cause the loss of old rule base data.
Above-mentioned each unit can be realized by various hardware processing element, such as, can realize by general processor or special processor, programmable logic device also can be used to realize, or have other hardware processing element of similar functions.In implementation procedure, unit can be realized by same hardware processing element respectively, or multiple unit is realized by a hardware processing element, does not limit at this.
Above-mentioned communication equipment can be router, GGSN (Gateway GPRS Supporting Node, GPRS router), RNC (Radio Network Controller, radio network controller), gateway etc. has the equipment of DPI function, or other adopt and the communication equipment of DPI system class like rule base.
During the upgrading of embodiment of the present invention rule base, before matching unit uses new regulation storehouse to mate new stream completely, still old rule base is used to mate to the old stream do not stopped, thus no matter can carry out detection for new stream and old stream, therefore, the interruption of business can not be caused, improve the reliability of system.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc.
Above-listed preferred embodiment; the object, technical solutions and advantages of the present invention are further described; be understood that; the foregoing is only preferred embodiment of the present invention; not in order to limit the present invention; within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.