Realize method and device thereof that the compensation of tandem connection monitor static charge error code check value is inserted down
Technical field
The present invention relates to network communications technology field, relate in particular to a kind of method and device thereof of realizing that the compensation of tandem connection monitor static charge error code check value is inserted down.
Background technology
In network service, TCM (tandem connection monitor) module mainly applies in the network environment of multi-operator, the section that the location error code takes place, and, as shown in Figure 1, in network, be as the criterion and determine the section that the position error code takes place, TCM-SOURCE (the source end of tandem connection monitor) and TCM-SINK (terminal of tandem connection monitor) must be set in pairs.Its operation principle mainly is by paired TCM-SOURCE and TCM-SINK certain section network to be monitored, thereby judges the working condition of this section network.Particularly exactly the data of present frame are carried out the B3 (static charge error code check value) that XOR obtains these frame data, and the result is inserted in the next frame data at TCM-SOURCE; Then adopt above-mentioned XOR computational methods to calculate the B3 of the corresponding Frame that receives again at TCM-SINK, to recomputate the B3 of acquisition and the B3 in the next frame data simultaneously compares, thereby judge and whether have error code in this section Network Transmission, be specially, if two values are identical, then there is not error code, otherwise has error code.
Usually frame data that transmit in network comprise the B3 of previous frame data and are used to write down the N1 byte of B3 error code (N1 byte records error code and alarm monitoring value), described B3 error code obtains for the XOR result of the B3 that goes out according to the actual B3 of previous frame data with according to the previous frame data computation of receiving, the N1 byte of described record B3 error code need be inserted in the current frame data down, as shown in Figure 2, because the B3 of present frame (being Frame N) need be inserted into down in the next frame (being Frame N+1), and the B3 of present frame is the result of a current frame data XOR, like this, the following actual B3 that all will change current frame data that inserts of each N1, therefore, for the B3 of the current frame data that guarantees down to insert in next frame remains unchanged, need compensate the back to B3 and insert in the next frame data, promptly carry out so-called TCM-B3 (tandem connection monitor static charge error code check value) compensation and insert operation down.
Compensate the compensation computing formula that adopted by protocol definition G.707 to inserting next frame B3, be specially: B3 ' (t)=(t-1) (t-1) B3 (t) of N1 (t-1) N ' of B3 (t-1) B3 ';
Wherein:
B3 represents the numerical value of B3 byte in the former data flow;
The numerical value of compensation back B3 byte is determined in B3 ' expression;
N1 represents the numerical value (being error code and alarm monitoring value initial value) of N1 byte in the former data flow;
The N1 byte numerical value that N1 ' expression is upgraded (error code and the alarm monitoring value that have promptly write down behind the new B3 error code newly are worth);
represents the bit XOR;
T represents that present frame constantly;
T-1 represents that previous frame constantly.
Although defined the computing formula of inserting under the compensation in the agreement,, also there is not a kind of concrete implementation to be used for TCM-B3 is compensated down slotting the processing at present owing in communication equipment, use this technology at present as yet.
Summary of the invention
The purpose of this invention is to provide a kind of method and device thereof of realizing that the compensation of tandem connection monitor static charge error code check value is inserted down, thereby can realize comparatively easily TCM-B3 is carried out inserting under the corresponding compensation processing.
The objective of the invention is to be achieved through the following technical solutions:
The present invention at first provides a kind of method that realizes that the compensation of tandem connection monitor static charge error code check value is inserted down, comprising:
Static charge error code check value in the previous frame data of A, recorder and the actual XOR result of slotting static charge error code check value down, i.e. static charge error code check value compensation median, and the error code of previous frame data and alarm monitoring value initial value and new value;
B, when new frame data arrive, obtain error code and the alarm monitoring value initial value and the new value of corresponding previous frame data, also call the static charge error code check value compensation median of the previous frame of preservation simultaneously, and each value carried out XOR, then, utilize the static charge error code check value compensation median of the present frame that XOR obtains and the static charge error code check value of present frame to carry out XOR;
C, result that XOR is obtained are as in the static charge error code check value byte that inserts in present frame under the tandem connection monitor static charge error code check value.
The present invention also provides a kind of device of inserting down based on the realization tandem connection monitor static charge error code check value compensation of said method, comprising:
Static charge error code check value compensation median register is used to preserve static charge error code check value compensation median, and new error code and the alarm monitoring value register and the XOR module of the error code of input data and alarm monitoring value register, generation;
When a new frame arrives, call the static charge error code check value compensation median of the previous frame in the static charge error code check value compensation median register, and the error code and the alarm monitoring value register of input data, the new error code that generates and the error code of the previous frame in the alarm monitoring value register and alarm monitoring value initial value and new value, and each value carried out XOR by the XOR module, the new static charge error code check value compensation median that then again XOR is obtained and the static charge error code check value XOR of present frame obtain the actual static charge error code check value offset of present frame, and insert in the static charge error code check value byte of present frame under the actual static charge error code check value offset that will calculate.
Described static charge error code check value compensation median register is connected with the new business index signal, when having new business to arrive, removes the static charge error code check value compensation median of wherein depositing at every turn.
Realization of the present invention makes and can realize comparatively easily tandem connection monitor static charge error code check value is compensated slotting down the processing in network service; And, also slotting formula under the compensation that defines in the agreement has been carried out corresponding processing among the present invention, thereby made and can realize inserting processing under the corresponding TCM-B3 compensation under the situation that take less resources of chip.The present invention is as the criterion and determines that the section that error code takes place in the bit walk network provides the corresponding techniques support.
Description of drawings
Fig. 1 is for realizing the schematic network structure of TCM;
Fig. 2 is the principle schematic of the corresponding B3 error code values of TCM in the prior art;
Fig. 3 is structural representation Fig. 1 of device of the present invention;
Fig. 4 is structural representation Fig. 2 of device of the present invention.
Embodiment
The method that realization tandem connection monitor static charge error code check value compensation of the present invention is inserted down and the embodiment of device thereof specifically describe as follows as shown in the figure:
Method of the present invention comprises: B3 (t) value in the present frame of at first determining to receive (being Frame N frame); Then, call the error code of previous frame (being Frame N-1 frame) of preservation and alarm monitoring value initial value and new value N1 (t-1), N1 ' (t-1), and static charge error code check value B3 (t-1) is worth and compensation deals after static charge error code check value B3 ' (t-1) be worth; At last, each value is carried out XOR according to slotting formula under the compensation of agreement regulation, and draw the TCM-B3 compensation that needs down interpolation B3 ' (t) and described B3 ' is inserted in the B3 byte of present frame under (t), thereby realize the operation that the TCM-B3 compensation is inserted down.
Based on said method, the invention provides a kind of device, as shown in Figure 3, its structure comprises the B3 register in the input data, the B3 register after the compensation, and imports the N1 value register (promptly importing the error code and the alarm monitoring value register of data) of data, new N1 value register (i.e. new error code of Sheng Chenging and alarm monitoring value register) and the XOR module that generates; When new frame data arrive, call N1 (t-1) value of the previous frame of preserving in the N1 value register of input data, the N1 ' that calls the previous frame of preserving in the new N1 value register of generation is value (t-1), and accesses (t-1) value of the B3 (t-1) of previous frame and B3 ' from the B3 register of input data and the B3 register after the compensation respectively; Then, with corresponding N 1 (t-1) value, N1 ' (t-1) value, B3 (t-1), B3 ' (t-1) B3 (t) value of value and present frame carry out XOR by the XOR module and handle, result of calculation is the tandem connection monitor static charge error code check value offset that the present invention needs, the promptly actual tandem connection monitor static charge error code check value of inserting down, to calculate at last under the TCM-B3 that inserts under the reality that obtains and insert in the B3 byte of present frame, thereby operation is inserted in the compensation that has realized TCM-B3 down.
The present invention also provides another kind of implementation, and the principle of wherein said method is with slotting computing formula both sides while XOR B3 (t) under the compensation of above-mentioned agreement regulation, obtains following formula:
B3′(t)B3(t)=B3(t-1)B3′(t-1)N1(t-1)N′(t-1);
And define (t) B3 (t) of A (t)=B3 ', so following formula can be expressed as:
A(t)=A(t-1)N1(t-1)N1′(t-1);
Wherein A (t) is exactly the B3 compensation median that we need, and it and B3 (t) XOR of importing just obtain actual B3 value of inserting down.As follows:
B3′(t)=B3(t)A(t)
It is as follows that simultaneously I am easy to release the initial value of B3 offset:
A(0)=B3′(0)B3(0)=0
Based on above-mentioned principle, method of the present invention is: when a new frame arrives, obtain the error code of corresponding previous frame and alarm monitoring value initial value N1 (t-1) and new value N1 ' (t-1), also call the B3 compensation median A (t-1) of the previous frame of preservation simultaneously, and with N1 (t-1), N1 ' (t-1) and A (t-1) value carry out XOR, thereby obtain the B3 compensation median A (t) of present frame, at last, utilize B3 (t) value and the described B3 compensation median A (t) of present frame to carry out XOR, the B3 offset B3 ' that obtains corresponding present frame (t), B3 ' is inserted in the present frame under (t), thereby realizes the operation that the TCM-B3 compensation is inserted down.
Based on the described method of the invention described above, device of the present invention as shown in Figure 4, construct an initial value and be 8 B3 compensation median registers of 0, described B3 compensation median register is used to preserve B3 compensation median, when a new frame arrives, call the B3 compensation median A (t-1) of previous frame, and with the new error code of the input error code of data and alarm monitoring value register and generation and alarm monitoring value register in the XOR result of the error code of the previous frame preserved and alarm monitoring value initial value and new value (being (t-1) value of N1 (t-1) value and N1 ') carry out XOR again and obtain new B3 and compensate median A (t), B3 value B3 (t) with present frame compensates following interpolation B3 ' (t) (being the B3 offset) with the actual B3 that B3 compensation median A (t) XOR that newly obtains obtains present frame again, at last, the B3 compensation that calculates is inserted in the B3 byte of present frame under the interpolation down.And, B3 compensation median register of the present invention also is connected with the new business index signal, when having new business to arrive at every turn, under the effect of new business index signal, remove the B3 compensation median wherein deposit so that new business carry out corresponding TCM-B3 compensation down slotting processing be not subjected to the influence of the B3 compensation median of the former business of wherein depositing.
Except that B3 compensation median register, when other each registers are new frame data arrival, refresh the corresponding data values that register is deposited among the present invention.
By foregoing description as can be seen, second kind of scheme provided by the invention saved the quantity of the register that adopts than first kind of scheme, saved the relevant chip resource.
Therefore, the present invention not only provides a kind of method and apparatus of realizing that the compensation of tandem connection monitor static charge error code check value is inserted down, but also has guaranteed that the method and apparatus realization that is provided is comparatively easy, reasonable.