Summary of the invention
The invention provides a kind of communication system, there is incompatible problem in interactive messages between the network element that uses the different editions agreement in the prior art in order to solve.The present invention also provides a kind of network element, and it is used in the above-mentioned communication system.The present invention provides a kind of match messages method based on above-mentioned communication system again.
Network element of the present invention comprises: the interface processing module is used for the message that sends and receive is carried out encoding and decoding; Core processing module is used to construct the message of transmission and handles the message that receives; Described network element also comprises: the match messages module, be connected between described interface processing module and the core processing module, be used to store the matched rule tables of data, and the message that sends and receive is carried out matching treatment according to the content of described tables of data, described message is for using the network element interactive messages of different editions agreement, if the message flow of described message meets the matched rule that presets, then this message is carried out corresponding matching treatment according to described matched rule, described matched rule comprises: critical field, the positional information of described critical field in described message flow, matching condition and processing rule, described matching treatment comprises: according to described processing rule the critical field of described message is made amendment, make its value fall into the process range of this network element or opposite end network element, and abandon described message according to described processing rule and type of message, the message of predefined type can not be sent and receive.
Communication system of the present invention, comprise: the network element that core processing module and interface processing module are formed, described core processing module is used to construct the message of transmission and handles the message that receives, and described interface processing module is used for the message that sends and receive is carried out encoding and decoding; Maintenance console is used to safeguard described network element; Described system also comprises: the match messages module, be connected between described interface processing module and the core processing module, and link to each other with described maintenance console, be used to store matched rule tables of data by described maintenance console configuration, and the message that sends and receive is carried out matching treatment according to the content of described tables of data, described message is for using the network element interactive messages of different editions agreement, if the message flow of described message meets the matched rule that presets, then this message is carried out corresponding matching treatment according to described matched rule, described matched rule comprises: critical field, the positional information of described critical field in described message flow, matching condition and processing rule, described matching treatment comprises: according to described processing rule the critical field of described message is made amendment, make its value fall into the process range of this network element or opposite end network element, and abandon described message according to described processing rule and type of message, the message of predefined type can not be sent and receive.Described match messages module is placed in the described network element, perhaps is independent of described network element.When described match messages module is independent of described network element, the corresponding match messages module of each network element.
The method of match messages of the present invention, comprise the following steps: network element receive message and to its decoding after, perhaps network element to message coding to be sent before, judge whether the message flow of described message meets default matched rule; If described message flow meets described matched rule, then this message is carried out corresponding matching treatment according to described matched rule; Otherwise, this message is not made matching treatment; Described message is for using the network element interactive messages of different editions agreement.Described matched rule comprises: critical field, the positional information of described critical field in described message flow, matching condition, and processing rule.
Described critical field is the type of message of described message and/or the cell of message.
The positional information of described critical field is represented with skew in the message flow and length.
Described matching condition is the span of setting as required.
The determination methods whether described message flow meets described matched rule comprises step: the positional information according to described critical field is searched described critical field in described message flow; Value and described matching condition with the critical field that finds contrast, if the value of described critical field falls into the span that described matching condition is set, judge that then this message flow meets described matched rule; Otherwise judgement does not meet.
Corresponding matching treatment comprises: according to described processing rule the critical field of described message is made amendment, make its value fall into the process range of this network element or opposite end network element; And abandon described message according to described processing rule and type of message, the message of predefined type can not be sent and receive.
Beneficial effect of the present invention is as follows: by connect a match messages module between the interface processing module of network element and core processing module, make described network element have the match messages function.Described network element is applied in the communication system, when this network element is received the message that other network element sends, after its reception and decoding, utilize matched rule default in the described match messages module that it is mated earlier, make this message meet the treatment conditions of this network element, be transferred to core processing module again and carry out subsequent treatment; When described network element when other network element sends message, utilize matched rule default in the described match messages module that it is mated earlier, make this message to be sent meet the treatment conditions of opposite end network element, the transmission of encoding again.By above-mentioned processing, use the network element of different editions agreement, and interactive messages can be compatible between the different network element of realizing.Match messages module of the present invention is not limited to and is embedded in the described network element, also can be separate with described network element, be placed in the system, and the network element that can be like this in the existing system adds the match messages function, reaches better match messages effect.
Embodiment
For the network element of use different editions agreement, and interactive messages can be compatible between the different network element of realizing, the invention provides a kind of network element with match messages module.
Be illustrated in figure 1 as the internal structure schematic diagram of network element of the present invention, this network element comprises as seen from the figure: the interface processing module of Xiang Lianing, match messages module and core processing module successively.
Described interface processing module, the message after being used for the message that sends encoded and will encode sends to the opposite end network element; And receive message that other network element sends and the message that receives is decoded.
Described core processing module, be used to handle receive and through the decoded message of described interface processing module, and construct message to be sent and offer described interface processing module.
Described match messages module is used to store the matched rule tables of data.According to described matched rule tables of data, described match messages module is to receiving and decoded message is carried out matching operation, makes the message after the coupling can be by this network element compatibility, and the transmission of messages after will mate is again carried out subsequent treatment to described core processing module; And according to described matched rule tables of data, described match messages module is carried out matching operation to the message to be sent and that coding is preceding of described core processing module structure, make the message after the coupling can compatible opposite end network element, the transmission of messages after will mating be again given the transmission of encoding of described interface processing module.
Be illustrated in figure 2 as networking communication system schematic diagram of the present invention, it comprises several described network elements as seen from the figure, and the match messages module in described each network element all links to each other with maintenance console.
Described maintenance console is used to provide user interface, can create and the edit messages matched rule by described interface, and described match messages rule are issued in the match messages module of each network element.Described maintenance console also provides conventional maintenance function.
Utilize said network element and communication system, the invention provides a kind of match messages method, use the network element of diversity of protocol versions, and normal interaction message between the different network element of realizing.This method may further comprise the steps:
-preset matching rule;
-network element is received message and to after its decoding, perhaps network element to message coding to be sent before, contrast with the message flow of described message and default matched rule;
The described message flow of-Ruo meets described matched rule, then according to described matched rule described message is carried out corresponding matching treatment; Otherwise, do not handle.
Below receive message flow and send message flow by described network element respectively and specifically describe match messages method of the present invention.
Example one: the message that described network element receives is mated, and its steps flow chart as seen from the figure, comprises following concrete implementation step as shown in Figure 3:
At first find out place incompatible between the network element of butt joint by protocal analysis and network element interoperability test, then by maintenance console configuration critical field, matching condition and processing rule, and be issued in the matching module of network element, in order to the message that sends and receive is mated, make the interface message can be compatible.Can adopt different coded systems for the network element interface message in the practical communication system, the described interface processing module in the network element is used to finish the Code And Decode work of message.Described interface message is a structure before coding or after the decoding, described message structure schematic diagram, as shown in Figure 4.In conjunction with this figure, if in the message body of the message that the transmitting terminal network element sends, type of message is 1 and to the value of field 3 without limits, and the local terminal network element is 1 message to type of message, the value that limits its field 3 can not be greater than 100, then following matched rule can be set in described maintenance console, and be issued in the match messages module of this receiving terminal network element:
Because local terminal is different for the span of the field in the message body 3 with the opposite end, so described type of message is set and field 3 is critical field;
The positional information of described critical field is represented with skew in the message flow and length, so above-mentioned definite length and the deviant of critical field in message flow also need be set in matched rule, is used to locate described critical field.Described length and deviant can be represented with byte or bit.Referring to Fig. 4, described type of message is in 0 to 1 byte, and described field 3 is in 6 to 7 bytes;
The value of message type field is 1 in the message body that matching condition is set to receive, and the value of field 3 is greater than 100;
Processing rule is set to field 3 is revised as 100;
In the default following step of back execution of finishing of described matched rule:
After S1, described network element with match messages function receive the message that other network element is sent in the system by the interface processing module, this message is decoded by described interface processing module.
After S2, the decoding, this message is transferred to described match messages module.Described match messages module is at first according to its preset keyword section (message type field and field 3), with and the default specific location information of described critical field in message flow, in the message flow of the message that receives, search described critical field.Described specific location information is represented (type of message is in 0 to 1 byte, and field 3 is in 6 to 7 bytes) with skew in the message flow and length.
S3, after finding described critical field, critical field that finds and the matching condition of presetting are contrasted one by one, (type of message is 1 if the cell value of described critical field and/or type of message fall into the span that matching condition limits, field 3 values are greater than 100), judge that then this message that receives meets matched rule, and change step S4 over to; Do not meet matched rule otherwise be judged to be, will not carry out matching treatment, directly carry out subsequent operation according to prior art.
S4, through contrast, when the value of critical field met described matching condition, for example: the cell value of message met some number ranges, then according to default processing rule this message was carried out corresponding operation (value of revising field 3 is 100).Described processing rule specifically comprises dual mode:
Mode one: the critical field value of described message is revised as predetermined value, makes it fall into the process range of this network element.
Mode two: abandon described message according to type of message, the message of predefined type is not received by this network element.Utilize this processing mode to test in the situation that abandons a certain class message fully to network element.
After finishing, the matching treatment operation carries out subsequent treatment for described core processing module this transmission of messages.
Example two: the message that described network element sends is mated.Owing to had a lot of network elements in the communication system, there is not described match messages module in these network elements, when these do not have the network element of described match messages module and network element of the present invention to carry out interacting message, by network element of the present invention before initiating a message, earlier this message is mated accordingly, make the opposite end network element can directly handle the message that receives.This routine steps flow chart as seen from the figure, comprises following concrete implementation step as shown in Figure 5:
Before flow process begins, create message matches rule, and be issued in the match messages module.(principle is identical with example one)
S1, described network element with match messages function are created message to be sent by core processing module.
S2, described message to be sent are transferred to described match messages module.Described match messages module is at first according to the critical field in its default matching condition, with and the default specific location information of described critical field in message flow, search described critical field in the message flow of message to be sent, described specific location information is represented with skew in the message flow and length.
S3, after finding described critical field, critical field that finds and the matching condition of presetting are contrasted one by one, if the cell value and/or the type of message of described critical field fall into the span that matching condition limits, judge that then this message to be sent meets matched rule, and change step S4 over to; Do not meet matched rule otherwise be judged to be, will not carry out matching treatment, directly carry out subsequent operation according to prior art.
S4, through contrast, when the value of critical field met described matching condition, for example: the cell value of message met some number ranges, then according to default processing rule this message was carried out corresponding operation.(identical) with example one
Encode and send after matching treatment is finished this transmission of messages for described interface processing module.
Corresponding above-mentioned communication system if described match messages module and described network element are separate, can make then that existing elements has the match messages function in the system.More can make match messages module of a plurality of network-element shares.Send and receive flow process by above-mentioned message and can reach match messages widely.
The present invention can upgrade message matches rule accordingly according to the continuous upgrading of protocol version, thus the various variations that the adaptive system upgrading brings.
In a word, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.