Background technology
In the prior art, global system for mobile communications 0340 (GSM0340) agreement is that the technology of GSM network point-to-point short message service realizes standard, has wherein described a kind of cascade short message service.The maximum length of common content of short message is 140 bytes, can hold 140 8 bit character or binary data, 70 unicode characters, or 160 7 bit character.But in the practical application of short message service, content of short message length is easy to surpass this restriction.In order to send the short message above wall scroll content of short message length restriction, the GSM0340 agreement has been stipulated this mechanism of utilizing the cascade of a plurality of segmentation short message to realize super long short message, i.e. cascade short message.
The overlength message that message sender will send splits into the segmented messages of a plurality of cascades, and the length of each segmented messages is no more than the message content length of agreement regulation, then these segmentations is independently sent to the message sink end.The cascade short message has added message header in content of short message; Be used for representing that current message is certain segmentation of a cascade message; The recipient of message assembles out complete cascade message after all segmentations of a cascade message are collected, and realizes the transmission of super long short message.
, the different segmentations of cascade short message; Send to the message sink end via different network elements probably; Perhaps send to the message sink end via the different nodes of identical network element; The cascade message fragment message that receiving terminal is received is not necessarily according to the original segmentation sequence arrangement of cascade short message, so the message sink end possibly can't normal group take on the complete content of cascade short message.Article one, each segmented messages of cascade message possibly have some segmented messages and lose in transmission course, and the cascade message fragment that causes the message sink end to be received is imperfect.
When the cascade short message carries out segmentation, maybe the coding of same character be split in the different segmented messages contents, message content interdependence between two adjacent sectional message can't independently be decoded in this case.Even segmented messages arrives receiving terminal in order, receiving terminal also can't in time be decoded and message content, and must wait for that next segmentation arrives, and just can decode.
Prior art cascade short message can't guarantee the reliability of self transmission, and each network element does not have unified processing method to cascade transmission of messages reliability in the GSM network, very easily causes cascade short message fragment loss, dislocation.
Therefore, prior art awaits improving and development.
Summary of the invention
The object of the invention is to provide a kind of segmentation affirmation mechanism to realize short-message system cascade short message transmission method; Through the mode of cascade short message segmentation affirmation mechanism and segmentation end filler, guarantee the reliability of cascade short message transmission and the independence of every segmented messages content.
Technical scheme of the present invention is following:
A kind of segmentation affirmation mechanism realizes short-message system cascade short message transmission method, and said short-message system comprises: a short message transmitting terminal; One short message receives end; One short message service center end; Said short message service center end receives end control connection mutually with said short message transmitting terminal, said short message respectively, and said cascade short message transmission method is following:
A, said short message transmitting terminal will wait that a cascade short message of sending out splits into a plurality of segmentations;
B, whether said short message transmitting terminal is inquired about the segmentation of said cascade short message wrong, and if not, said short message transmitting terminal receives end through said short message service center end to said short message and sends first segmentation, and wait-for-response;
After C, said short message service center end are received said first segmented messages, return response to said short message transmitting terminal immediately;
After D, said short message transmitting terminal received the success response of said first segmentation, said short message service center end returned the receipt of said first segmentation to the short message transmitting terminal, and shows this segmentation message content, and the segment information of message fragment;
After E, said message sending end are received the success receipt of said first segmentation, repeat above step and continue to send subsequent segment.
Described method, wherein, said short message transmitting terminal when said short message receiving terminal sends said first segmentation, is set a time threshold through short message service center.
Described method, wherein, said step B also comprises:
B1, find the segmentation of cascade short message when said short message transmitting terminal same character is split in the different segmentations, then fill NUL, the complete coding of this character is moved on in the back segmentation at last segmented messages end.
Described method, wherein, said step D also comprises:
D1, when said short message transmitting terminal receives the failure response of said first segmentation, then short message service center analyzes its failure cause.
Described method, wherein, said step D1 may further comprise the steps:
D11, be segmented into permanent error when the response analysis result shows said first, then the cascade short message sends failure;
D12, be segmented into provisional mistake, then return and carry out above-mentioned steps B when the response analysis result shows said first;
D13, do not receive first segmentation response results, then return and carry out above-mentioned steps B when the response analysis result shows because of surpassing said time threshold.
Described method, wherein, the execution number of times of carrying out above-mentioned steps B that returns described in said step D12 or the D13 is provided with the limit.
Described method, wherein, said step e is further comprising the steps of:
E1, receive said first minute segment fault receipt when said short message transmitting terminal, then the cascade short message sends failure;
E2, when said short message transmitting terminal because overtime threshold value and do not receive said first segmentation receipt, then the cascade short message sends failure.
Described method, wherein, its form of said receipt is global system for mobile communications 0340 an agreement specified standard mobile phone receipt form.
A kind of segmentation affirmation mechanism provided by the present invention realizes short-message system cascade short message transmission method; Owing to adopted segmented messages to send the mode that wait acknowledge is machine-processed and fill character in the segmentation end; Avoid abnormal conditions such as the segmentation of cascade short message is lost, dislocation effectively, improved practicality, flexibility and the reliability of cascade short message service.
Embodiment
Below in conjunction with accompanying drawing, will make a more detailed description each preferred embodiment of the present invention.
A kind of segmentation affirmation mechanism of the present invention realizes short-message system cascade short message transmission method, and its GSM0340 agreement cascade short message coding structure is as shown in Figure 1, and it comprises:
Data length (UDL): be used to identify and do not comprise thebyte length 11 of this field at interior content of short message, unit is 8 bits;
Data head sign length (UDHL): be used to identify and do not comprise thelength 12 of this field at interior content of short message head, unit is 8 bits;
Information word identifier (IEI): be used for identifying content of short message head information word identifier; Account for one 8 bit; Wherein reference number length is that the cascade short message header unit identifier of 8 bits is 0x00, and reference number length be the cascade short message header unit identifier of 16 bits is 0x08;
Information word data length (IEDL): be used to store and do not comprise this field in interior cascade short message information metadata, and sign do not comprise this field at interior cascade short message informationunit byte length 13, unit is 8 bits;
Cascade short message reference number (IED1): be used for identifying the sequence number of cascade short message, all segmented messages cascade short message reference numbers of cascade short message must be consistent.When the information word identifier was 0x00, reference number accounted for 18 bit, and when the information word identifier was 0x08, reference number accounted for 28 bits;
The cascade short message splits information (IED2): be used to show how many bar segmented messages this cascade short message splits into altogether, accounts for one 8 bit, and span is 1~255;
Current cascade short message sequence number information (IED3): in order to show the sequence number of current segmented messages in the cascade short message, account for one 8 bit, value increases progressively since 1 in proper order;
Note (SM): be used to store the content of short message of removing outside the content of short message head,, then place filler before the message content, to protect the 7 bits of encoded ends of message on 8 bit boundaries if it is 7 bits of encoded forms.
Cascade short message segmentation affirmation mechanism of the present invention, said short-message system comprises: the short message transmitting terminal; Short message receives end; Short message service center's end; Short message service center's end receives end control connection mutually with said short message transmitting terminal, said short message respectively, and its concrete operations flow process is as shown in Figure 2, and its concrete steps are following:
A, short message transmitting terminal will wait that a cascade short message of sending out splits into i segmentation promptly: A1 ... Ai;
Whether the segmentation of B, said short message transmitting terminal inquiry cascade short message is wrong, and whether promptly same character splits in the different segmentations, if not, and execution in step C then; If, then fill NUL at last segmented messages end, the complete coding of this character is moved on in the back segmentation;
C, said short message transmitting terminal receive end through short message service center to short message and send said segmentation A1, and wait for said short message service center feedback response information, set an operating time threshold value simultaneously;
After said segmentation A1 message is received by D, said short message service center, immediately to short message transmitting terminal feedback response information;
E, receive the failure response information of said segmentation A1 when said short message transmitting terminal, then short message service center analyzes failure response information, the response analysis result.
F, be permanent error when the response analysis result shows said segmentation A1, then the cascade short message sends failure;
G, be provisional mistake when the response analysis result shows said segmentation A1, and this segmentation message number of retries no show upper limit, then repeating to return and carry out above-mentioned steps B, otherwise stop retry, the cascade short message sends failure;
H, show that said segmentation A1 sends that the time limit surpasses said time threshold and the response message of not receiving segmentation A1 as the response analysis result; And this segmentation message number of retries no show upper limit; Then repeat above-mentioned steps B, otherwise stop retry, the cascade short message sends failure;
I, receive the success response information of said segmentation A1 when said short message transmitting terminal, then said short message service center returns the receipt of said segmentation A1 to the short message transmitting terminal, and shows this segmentation message content, and the segment information of message fragment;
K, receive segmentation A1 receipt failure information when said short message transmitting terminal, then the cascade short message sends failure;
L, when said short message transmitting terminal surpasses the transmitting time threshold value and does not receive segmentation A1 acknowledgement information, then the cascade short message sends failure;
M, receive segmentation A1 success receipt information when said short message transmitting terminal, then said segmentation A1 sends successfully, repeats above step afterwards and continues to send subsequent segment.
In above cascade short message segmentation affirmation mechanism concrete operations flow process, when cascade short message transmitting terminal sends the segmentation of cascade short message, independent in order each segmentation of transmission.After transmitting terminal whenever sends the segmentation of a cascade short message; Wait for the report of receiving terminal return state; Set a time threshold simultaneously, at the appointed time receive this segmented messages receipt that receiving terminal returns in the threshold value, continue to send next segmentation and wait for the affirmation of receiving terminal receipt.When transmitting terminal sends a segmentation, but at the appointed time do not receive the receipt that receiving terminal returns in the threshold value, send current segmented messages to receiving terminal again, avoided segmented messages to lose like this.The message sink end returns receipt to transmitting terminal after whenever receiving a segmented messages immediately, shows this segmentation message content in short message service center simultaneously, and the segment information of message fragment., the short message transmitting terminal can same character be split in the different segmentations when finding the cascade message fragment; Add the filling NUL at last segmented messages end; The complete coding of this character is moved on in the back segmentation, guaranteed the independence of every segmented messages content so effectively.
A kind of segmentation affirmation mechanism of the present invention realizes short-message system cascade short message transmission method, and wherein the segmentation end mechanism of filling character is as follows:
According to the GSM0340 agreement, the maximum length of content of short message is 140 bytes, can hold 140 8 bit character or binary data, 70 unicode characters, or 160 7 bit character.For the segmented messages of cascade short message, need place cascade short message head in the content of short message starting position.
Cascade short message head with 8 bit reference numbers is an example, and cascade short message head length degree is 6 bytes, and the content of short message maximum length is 134 bytes.Under 8 bit character or binary data coding situation, minimum code unit is a byte, can not cause the coding of a character or binary data to be split in two segmented messages, need not fill character at the segmentation end.Under 7 bits of encoded situation; Minimum code unit is 7 hytes; And the filler filling necessity between cascade short message head and the message content finishes on 8 bit boundaries 7 hytes; Can not cause the coding of a character or binary data to be split in two segmented messages, need not fill character at the segmentation end.But; For the unicode character,, possibly cause the coding of a character or binary data to be split in two segmented messages because the minimum code unit of unicode is 2 bytes; Therefore when character-coded 2 bytes of unicode are split in the different segmentations; Need fill a NUL at last segmentation end, can guarantee that like this this character code is not split, guarantee the independence of every segmented messages content.Adopt the segmentation end to fill character after the mechanism, mobile phone terminal or other receiving device can show the message content of this segmentation immediately after receiving a cascade message fragment, need not wait for subsequent segment.
Segmentation affirmation mechanism of the present invention realizes short-message system cascade short message transmission method; Owing to adopted through the cascade short message and divided segment acknowledgement and the segmentation end mechanism of filling character; Guaranteed the message fragment that the cascade short message receiving is received order, avoid losing of message fragment, guaranteed the reliability of cascade short message transmission, avoid same character to be split transmission simultaneously by two segmentations; Guaranteed every segmented messages content mutual independence; Can avoid abnormal conditions such as the segmentation of cascade short message is lost, dislocation, because strictness has guaranteed to divide the transmission sequence of short message, receiving terminal is whenever received a segmented messages simultaneously; This segmented messages content be can independently decode and show, practicality, flexibility and the reliability of cascade short message service improved.
Should be understood that the description of above-mentioned specific embodiment is comparatively detailed, can not therefore be interpreted as the restriction to scope of patent protection of the present invention, scope of patent protection of the present invention should be as the criterion with accompanying claims.