Summary of the invention
The method that the object of the present invention is to provide a kind of PDA super long short message to send, it can overcome the transmission quantitative limitation, greatly improves the advantage of PDA super long short message, and can effectively read.
The object of the present invention is achieved like this: the method that a kind of super long short message sends, and which comprises at least content segmentation is an above packet that meets the communication protocol capacity requirement, then packing sends.
Particularly, be step 1: according to the encode requirement of the first heap(ed) capacity of communication protocol 7-bit, intercept the content of this maximum length from the file head or tail, and check whether this content is full 7-bit coding; If so, then carry out step 4; Not then carry out step 2;
Step 2: according to the encode requirement of the second heap(ed) capacity of communication protocol 8-bit, intercept the content of this maximum length from the file head or tail, and check whether this content has an odd number 7-bit encoded content, if having then execution in step 3; If no, execution in step 4 then;
Step 3: reduce by a byte intercepting content from maximum length;
Step 4: with the content packaging that intercepts, send;
Step 5: from intercept point, repeating step 1 is cut apart complete to content whole.
In packet header or the bag tail identifier is set, receiving device is according to sending address information and identifier information link bag content, content-data regains one's integrity.
According to the technique scheme analysis as can be known, the present invention has expanded a complete short message length greatly, has given full play to the ability of PDA word processing, has enriched the content of short message.
Embodiment
The present invention is the method that a kind of super long short message sends.
Because the restriction of agreement can only send 70 for Chinese character.So the way of cutting apart before adopt sending namely is divided into take 70 characters as a short message for the information greater than 70 Chinese characters and sends, so circulates, until send all information.For example, the length of short message is 215, then is divided into 70,70,70, five, totally four bags, and the recipient receives 4 short messages altogether.So just finished the short message that sends greater than 70 Chinese characters.
Above-mentioned solution is feasible, but the short message format in the reality may be very complicated, as not treating with a certain discrimination, all can cause confusion as border intercepting character with 70 Chinese characters, or the waste of resource.Be mainly manifested in the following aspects:
1, mess code appears
Because there is an English alphabet 4 (1 byte) centre, remaining Chinese character all is two bytes, so the position (140 byte) to 70 Chinese characters is blocked, at this moment later Chinese character just all can misplace, being shown on others mobile phone will be mess code entirely, does not see it being what information at all.So before transmission, must process, prevent that similar thing from occuring.
2, redundancy appears in the bag number of short message, causes telephone expenses to increase
So-called redundant should the transmission by N bag, the result but sends with N+1 bag (or more), will cause unnecessary waste like this.Such as:
If if at this moment still 4 short messages will occur with 70 Chinese characters (140 byte) boundary, in fact because English can send at most 160, so above-mentioned in fact only just can being sent with 3 bags.So this situation also will be processed before transmission.
Being treated to before sending:
Step 1: according to the encode requirement of the first heap(ed) capacity of communication protocol 7-bit, for example then 160 bytes intercept the content of this maximum length from the file head or tail, and check in 160 bytes whether all be ASCII character, if so, then carry out step 4; Not then carry out step 2;
Step 2: according to the encode requirement of the second heap(ed) capacity of communication protocol 8-bit, the previous step maximum length is set as 140 bytes, intercepts the content of this maximum length from the file head or tail, and check whether this content has an odd number 7-bit encoded content, if have, then execution in step 3; If no, illustrate in this content entirely for Chinese character or be the combination of Chinese character and even number 7-bit code character, then execution in step 4;
Step 3: reduce by a byte from maximum length, namely from 139 byte intercepting contents, guarantee that the Chinese character byte is complete, thus the possibility of having avoided mess code to occur.
Step 4: with the content packaging that intercepts, send:
Step 5: from intercept point, repeating step 1 is cut apart complete to content whole.
3, the bag number of information may cause the inconvenience reading too much
After sending, the data after the over-segmentation may not can be dealt into the destination according to order, arrive first such as last bag, and the first bag arrives at last, make troubles for like this people who reads, so need to be when sending, in packet header or the bag tail identifier is set, receiving device is according to sending address information and identifier information link bag content, the content-data that regains one's integrity marks, with easy-to-read.