Summary of the invention
Based on this, be necessary the technical problem of the operational inconvenience that file too large for file and that cause sends, a kind of method that can improve the Transmit message of the convenience in file transmit operation is provided.
In addition, be also necessary to provide a kind of terminal that can improve the convenience in file transmit operation.
A method for Transmit message, is characterized in that, described method comprises:
Reception is to the instruction of recipient's Transmit message;
Reception is from the request of recipient's compression file to be sent;
According to described request, to sent file, compress processing;
Send the file of processing through described compression.
In an embodiment, described method also comprises step therein: whether the memory capacity that judges described file exceeds preset capacity threshold;
The described step of processing of compressing to sent file according to described request, is specially:
When being judged as YES, according to described request, to sent file, compress processing.
In an embodiment, described when being judged as YES therein, according to described request, to sent file, compress the step of processing, comprising:
When being judged as YES, obtain the attribute information of file to be sent;
According to the attribute information obtaining, determine the compression algorithm that has preset corresponding relation with described attribute information;
According to the compression algorithm that described request utilization is definite, to sent file, compress processing.
In an embodiment, described attribute information comprises the first attribute information or the second attribute information therein;
Described method also comprises step:
There is the first corresponding relation in preset the first attribute information and Lossy Compression Algorithm;
There is the second corresponding relation in preset the second attribute information and lossless compression algorithm;
The attribute information that described basis is obtained is determined the step that has the compression algorithm of preset corresponding relation with described attribute information, is specially:
When the attribute information obtaining is the first attribute information, according to described the first corresponding relation, determine Lossy Compression Algorithm;
Or
When the attribute information obtaining is the second attribute information, according to described the second corresponding relation, determine lossless compression algorithm.
In an embodiment, described when being judged as YES therein, according to described request, to sent file, compress the step of processing, comprising:
When being judged as YES, calculate file to be sent memory capacity after overcompression is processed;
Determine when result of calculation is more than or equal to capacity threshold, according to described request, to sent file, divide rolling compression to process.
The present invention also proposes a kind of terminal, and described terminal comprises:
Receiver module, for receiving to the instruction of recipient's Transmit message;
Described receiver module, also for receiving the request from recipient's compression file to be sent;
Compression module, compresses processing for the request receiving according to described receiver module to sent file;
Sending module, for sending the file of processing through described compression.
In an embodiment, it is characterized in that therein, described terminal also comprises judge module, for judging whether the memory capacity of described file exceeds preset capacity threshold;
Described compression module, specifically for when judgment result is that of described judge module is, the request receiving according to described receiver module is compressed processing to sent file.
In an embodiment, described compression module, comprising therein:
Attribute acquiring unit, for when judgment result is that of described judge module is, obtains the attribute information of file to be sent;
Algorithm determining unit, determines for the attribute information obtaining according to described attribute acquiring unit the compression algorithm that has preset corresponding relation with described attribute information;
Compression processing unit, utilizes the definite compression algorithm of described algorithm determining unit to compress processing to sent file for the request receiving according to described receiver module.
In an embodiment, it is characterized in that therein, described attribute information comprises the first attribute information or the second attribute information;
Described terminal also comprises preset module, for preset the first attribute information and Lossy Compression Algorithm, has the first corresponding relation; , also for preset the second attribute information and lossless compression algorithm, there is the second corresponding relation in described preset module;
Described algorithm determining unit, while being the first attribute information specifically for the attribute information obtaining when attribute acquiring unit, determines Lossy Compression Algorithm according to the first corresponding relation that described preset module is preset;
Or
When the attribute information obtaining when attribute acquiring unit is the second attribute information, according to the second corresponding relation that described preset module is preset, determine lossless compression algorithm.
In an embodiment, it is characterized in that therein, described compression module, comprising:
Calculation of capacity unit, for when judgment result is that of described judge module is, calculates file to be sent memory capacity after overcompression is processed;
Bundling compression unit, when determining that the result of calculation of described calculation of capacity unit is more than or equal to capacity threshold, the request receiving according to described receiver module divide rolling compression processing to sent file.
The method of above-mentioned Transmit message and terminal, by receiving the instruction to recipient's Transmit message, then receive the request from recipient's compression file to be sent, according to request, to sent file, compress processing, send the file of processing through described compression.Therefore, according to recipient's request, do not carry out extra operation and directly file compressed, having improved the operational convenience that file sends.
Embodiment
As shown in Figure 1, in one embodiment, the present invention proposes a kind of method of Transmit message, the method is carried out by terminal, specifically comprises following content:
110, receive the instruction to recipient's Transmit message.
User, by terminal Transmit message, distinguishes according to transmission direction, and terminal is as transmit leg, and the opposing party who receives file is the recipient who describes in step 110.User will can input instruction to recipient's Transmit message on the display interface of terminal, and terminal receives to the instruction of recipient's Transmit message.Wherein, display interface can be the interface of file management application in terminal, or the interface of transmission class application, or the interface of other application programs, at this, does not limit.
120, receive the request from recipient's compression file to be sent.
For guaranteeing the reliability of file transfer, recipient can ask to compress to sent file, and terminal can receive this request and process.File to be sent, the state of the file that will send that specifically finger is mentioned in step 110 before formal transmission.
130, according to request, to sent file, compress processing.
Terminal receives after the request from recipient, starts to compress processing to sent file.The detailed process that compression is processed can be to use to comprise that the various compression algorithms of Lossy Compression Algorithm and/or lossless compression algorithm compress to sent file, finally obtains the file of processing through overcompression.The memory capacity of file generally can significantly reduce after overcompression, and less being more conducive to of file to be sent memory capacity after overcompression sends.
140, send the file of processing through overcompression.
Terminal sends to recipient by the file of processing through overcompression, completes the process that file sends.
In sum, the present invention does not carry out extra operation according to recipient's request and directly file is compressed, and has improved the operational convenience that file sends.
As shown in Figure 2, proposed in one embodiment the method for another kind of Transmit message, the method is carried out by terminal, specifically comprises following content:
210, receive the instruction to recipient's Transmit message.
User, by terminal Transmit message, distinguishes according to transmission direction, and terminal is as transmit leg, and the opposing party who receives file is the recipient who describes in step 210.User will can input instruction to recipient's Transmit message on the display interface of terminal, and terminal receives to the instruction of recipient's Transmit message.Wherein, display interface can be the interface of file management application in terminal, or the interface of transmission class application, or the interface of other application programs, at this, does not limit.
220, receive the request from recipient's compression file to be sent.
For guaranteeing the reliability of file transfer, recipient can ask to compress to sent file, and terminal can receive this request and process.File to be sent, the state of the file that will send that specifically finger is mentioned in step 110 before formal transmission.
Whether the memory capacity that 230, judges file exceeds preset capacity threshold.
In theory to obtaining the memory capacity less than original document after compressing file, but in the practice of the method for Transmit message, no matter whether some file is through overcompression, for the convenient degree of transmission speed and transmission, do not improve too many.For example memory capacity is the small documents of tens k, before and after compression, memory capacity changes little, no matter this is directly to send this document according to the scheme of prior art if directly having caused, or after file being compressed to processing by recipient's request in the present embodiment, send again, all do not bring the improvement of transmission speed and the convenient degree of transmission.But for large file, memory capacity changes greatly before and after compression, after file being compressed to processing by recipient's request in the present embodiment, send and have better effect again.So, can be by setting in advance a capacity threshold, then whether the memory capacity by terminal judges file to be sent exceeds preset capacity threshold, then carries out the processing of follow-up correspondence.By the memory capacity to sent file, carry out intelligent decision, directly improve the efficiency that the present embodiment is processed.
240,, when being judged as YES, according to request, to sent file, compress processing.
When the memory capacity that judgment result is that file to be sent obtaining when step 230 has exceeded capacity threshold, assert that file to be sent is larger, terminal is compressed processing according to recipient's request to sent file.The detailed process that compression is processed can be to use to comprise that the various compression algorithms of Lossy Compression Algorithm and/or lossless compression algorithm compress to sent file, finally obtains the file of processing through overcompression.
250, send the file of processing through overcompression.
Terminal sends to recipient by the file of processing through overcompression, completes the process that file sends.
In an embodiment, step 240 specifically can realize by following steps 241 to 243 therein.Be that step 240 specifically comprises:
241,, when being judged as YES, obtain the attribute information of file to be sent.
When the memory capacity that judgment result is that file to be sent obtaining when step 230 has exceeded capacity threshold, terminal starts to obtain the attribute information of file to be sent.For example, in attribute information, can be the information of the type of supporting paper, by the type of file, can learn that this document is the file of audio file, video file, text, image file or other types.Attribute information can also be the information of other attributes of description document, at this, does not limit.
242, according to the attribute information obtaining, determine the compression algorithm that has preset corresponding relation with attribute information.
In file to be sent, can be the set of the file that attribute information is identical, can be also the set of the different file of attribute information.When the attribute information of file to be sent is different, by same compression algorithm, compress processing, can not obtain best effect.So can, by setting in advance the mode that has corresponding relation between the attribute information of file and compression algorithm, determine and use which kind of compression algorithm according to the attribute information of file to be sent.With file including video file A to be sent and text B, the attribute information of file is that the type of file is example, to A and B, use same compression algorithm can not obtain best compression effectiveness, thus can be different according to the type of A and B, determine and use different compression algorithms.
243, according to request, utilize definite compression algorithm to compress processing to sent file.
When step 242 has been determined after compression algorithm, terminal, according to recipient's request, utilizes definite compression algorithm to compress processing to sent file.
In an embodiment, the attribute information of mentioning in step 241 comprises the first attribute information or the second attribute information therein;
The present embodiment method also comprises step:
There is the first corresponding relation in preset the first attribute information and Lossy Compression Algorithm;
There is the second corresponding relation in preset the second attribute information and lossless compression algorithm.
Step 242 is specially:
When the attribute information obtaining is the first attribute information, according to the first corresponding relation, determine Lossy Compression Algorithm; Maybe, when the attribute information obtaining is the second attribute information, according to the second corresponding relation, determine lossless compression algorithm.
Still with file including video file A to be sent and text B, the type that the attribute information of file is file is example, and wherein, text type belongs to the first attribute information, and video type belongs to the second attribute information; Compression algorithm comprises Lossy Compression Algorithm C1 and lossless compression algorithm C2.In terminal, set in advance video type and Lossy Compression Algorithm and had the first corresponding relation; There is the second corresponding relation in text type and lossless compression algorithm.Particularly, when getting file A to be sent and be video type, according to the first corresponding relation, determine Lossy Compression Algorithm C1, correspondingly, the follow-up Lossy Compression Algorithm C1 that utilizes compresses processing to file A; Maybe, when obtaining file B to be sent and be text type, according to the second corresponding relation, determine lossless compression algorithm C2, correspondingly, the follow-up Lossy Compression Algorithm C2 that utilizes compresses processing to file B.By distinguishing the different attribute information of file to be sent, use corresponding compression algorithm to compress processing to each file, can obtain good compression effectiveness.
When receiving file, recipient there are some restrictions, for example only can receive the file of particular memory capacity at every turn, even if still may occur that the memory capacity of the file after overcompression is processed is greater than recipient's restriction in this case after file compresses processing, make the process of Transmit message become difficult.So in an embodiment, step 240 specifically can realize by following steps 244 to 245 therein.Be that step 240 specifically comprises:
244,, when being judged as YES, calculate file to be sent memory capacity after overcompression is processed.
When the memory capacity that judgment result is that file to be sent obtaining when step 230 has exceeded capacity threshold, start to calculate file to be sent memory capacity after overcompression is processed.Now do not compress, by calculating the mode of memory capacity, estimate file to be sent situation after overcompression is processed.
245, determine when result of calculation is more than or equal to capacity threshold, according to request, to sent file, divide rolling compression to process.
According to the result of calculation obtaining in step 244, to determine when file to be sent memory capacity after overcompression is processed is more than or equal to capacity threshold, terminal divides rolling compression to process according to recipient's request to sent file.
Capacity threshold can be adjusted into and be less than or equal to the numerical value that recipient receives file restriction, then by the mode of estimating, calculate, according to result of calculation, determine that file to be sent memory capacity after overcompression is processed is more than or equal to capacity threshold, according to a minute method for rolling compression processing, compressing file to be sent is become to several small documents, the memory capacity of each small documents meets recipient's restriction requirement.
As shown in Figure 3, the present invention also proposes a kind of terminal, and terminal comprises:
Receiver module 310, for receiving to the instruction of recipient's Transmit message;
Receiver module 310, also for receiving the request from recipient's compression file to be sent;
Compression module 320, compresses processing for the request receiving according to receiver module 310 to sent file;
Sending module 330, for sending the file that 320 compressions are processed through compression module.
The instruction that receiver module 310 receives to recipient's Transmit message; The request that receiver module 310 receives from recipient's compression file to be sent; The request that compression module 320 receives according to receiver module 310 is compressed processing to sent file; Sending module 330 sends the file that 320 compressions are processed through compression module.
User, by terminal Transmit message, distinguishes according to transmission direction, and terminal is as transmit leg, and the opposing party who receives file is recipient.User will can input instruction to recipient's Transmit message on the display interface of terminal, and 310 receptions of receiver module are to the instruction of recipient's Transmit message.Wherein, display interface can be the interface of file management application in terminal, or the interface of transmission class application, or the interface of other application programs, at this, does not limit.
For guaranteeing the reliability of file transfer, recipient can ask to compress to sent file, and receiver module 310 can receive this request and process.File to be sent, the state of the file that specifically finger will send before informal transmission.
The request that compression module 320 receives according to receiver module 310 is compressed processing to sent file, the detailed process that wherein compression is processed can be to use to comprise that the various compression algorithms of Lossy Compression Algorithm and/or lossless compression algorithm compress to sent file, finally obtains the file of processing through overcompression.The memory capacity of file generally can significantly reduce after overcompression, and less being more conducive to of file to be sent memory capacity after overcompression sends.Then by sending module 330, the file that 320 compressions are processed through compression module is sent.
Therefrom can find out, the present invention does not carry out extra operation according to recipient's request and directly file is compressed, and has improved the operational convenience that file sends.
As shown in Figure 4, proposed in one embodiment another kind of terminal, this terminal comprises:
Receiver module 410, for receiving to the instruction of recipient's Transmit message;
Receiver module 410, also for receiving the request from recipient's compression file to be sent;
Judge module 420, judges for the request receiving according to receiver module 410 whether the memory capacity of file exceeds preset capacity threshold;
Compression module 430, for when judgment result is that of judge module 340 is, the request receiving according to receiver module 410 is compressed processing to sent file;
Sending module 440, for sending the file that 430 compressions are processed through compression module.
The instruction that receiver module 410 receives to recipient's Transmit message; Receiver module 410 also receives the request from recipient's compression file to be sent; The request that judge module 420 receives according to receiver module 410 judges whether the memory capacity of file to be sent exceeds preset capacity threshold; Compression module 430 is when judgment result is that of judge module 340 is, the request receiving according to receiver module 410 is compressed processing to sent file; Sending module 440 sends the file that 430 compressions are processed through compression module.
In theory to obtaining the memory capacity less than original document after compressing file, but in practice, no matter whether some file is through overcompression, for the convenient degree of transmission speed and transmission, do not improve too many.For example memory capacity is the small documents of tens k, before and after compression, memory capacity changes little, no matter this is directly to send this document according to the scheme of prior art if directly having caused, or after file being compressed to processing by recipient's request, send again, all do not bring the improvement of transmission speed and the convenient degree of transmission.But for large file, before and after compression, memory capacity changes greatly, compression module 430 sends and has better effect again after file being compressed to processing by recipient's request.So, can be by setting in advance a capacity threshold, the request then being received according to receiver module 410 by judge module 420 judges whether the memory capacity of file to be sent exceeds preset capacity threshold, then carries out the processing of follow-up correspondence.By the memory capacity to sent file, carry out intelligent decision, directly improve the efficiency that the present embodiment is processed.
When the memory capacity that judgment result is that file to be sent obtaining when judge module 420 has exceeded capacity threshold, assert that file to be sent is larger, compression module 430 compresses processing to sent file again.The detailed process that compression is processed can be to use to comprise that the various compression algorithms of Lossy Compression Algorithm and/or lossless compression algorithm compress to sent file, finally obtains the file of processing through overcompression.
As shown in Figure 5, in an embodiment, compression module 430 comprises attribute acquiring unit 510, algorithm determining unit 520 and compression processing unit 530 therein.
Attribute acquiring unit 510, for when judgment result is that of judge module 420 is, obtains the attribute information of file to be sent; For example, in attribute information, can be the information of the type of supporting paper, by the type of file, can learn that this document is the file of audio file, video file, text, image file or other types.Attribute information can also be other attribute information of description document, at this, does not limit.
Algorithm determining unit 520, determines for the attribute information obtaining according to attribute acquiring unit 510 compression algorithm that has preset corresponding relation with attribute information.In file to be sent, can be the set of the file that attribute information is identical, can be also the set of the different file of attribute information.When the attribute information of file to be sent is different, by same compression algorithm, compress processing, can not obtain best effect.So can, by setting in advance the mode that has corresponding relation between the attribute information of file and compression algorithm, determine and use which kind of compression algorithm according to the attribute information of file to be sent.With file including video file A to be sent and text B, the attribute information of file is that the type of file is example, to A and B, use same compression algorithm can not obtain best compression effectiveness, thus can be different according to the type of A and B, determine and use different compression algorithms.
Compression processing unit 530, utilizes the definite compression algorithm of algorithm determining unit 520 to compress processing to sent file for the request receiving according to receiver module 410.When algorithm determining unit 520 has been determined after compression algorithm, terminal, according to recipient's request, utilizes definite compression algorithm to compress processing to sent file.
In an embodiment, the attribute information that attribute acquiring unit 510 will obtain comprises the first attribute information or the second attribute information therein.Terminal also comprises preset module, for preset the first attribute information and Lossy Compression Algorithm, has the first corresponding relation; , also for preset the second attribute information and lossless compression algorithm, there is the second corresponding relation in preset module.Algorithm determining unit 520, while being the first attribute information specifically for the attribute information obtaining when attribute acquiring unit 510, determines Lossy Compression Algorithm according to the first corresponding relation that preset module is preset; Or the attribute information obtaining when attribute acquiring unit 510 is while being the second attribute information, according to the second corresponding relation that preset module is preset, determines lossless compression algorithm.
Still with file including video file A to be sent and text B, the type that the attribute information of file is file is example, and wherein, text type belongs to the first attribute information, and video type belongs to the second attribute information; Compression algorithm comprises Lossy Compression Algorithm C1 and lossless compression algorithm C2.Preset module has set in advance video type and Lossy Compression Algorithm exists the first corresponding relation; There is the second corresponding relation in text type and lossless compression algorithm.Particularly, when attribute acquiring unit 510 gets file A to be sent and is video type, algorithm determining unit 520 is determined Lossy Compression Algorithm C1 according to the first corresponding relation, and correspondingly, 530 of subsequent compression processing units utilize Lossy Compression Algorithm C1 to compress processing to file A; Or when attribute acquiring unit 510 obtains file B to be sent and is text type, algorithm determining unit 520 is determined lossless compression algorithm C2 according to the second corresponding relation, correspondingly, 530 of subsequent compression processing units utilize Lossy Compression Algorithm C2 to compress processing to file B.By distinguishing the different attribute information of file to be sent, use corresponding compression algorithm to compress processing to each file, can obtain good compression effectiveness.
When receiving file, recipient there are some restrictions, for example only can receive the file of particular memory capacity at every turn, even if still may occur that the memory capacity of the file after overcompression is processed is greater than recipient's restriction in this case after file compresses processing, make the process of Transmit message become difficult.So as shown in Figure 6, in an embodiment, compression module 430 comprises calculation of capacity unit 610 and bundling compression unit 620 therein.
Calculation of capacity unit 610, for when judgment result is that of judge module 420 is, calculates file to be sent memory capacity after overcompression is processed; When the memory capacity that judgment result is that file to be sent obtaining when judge module 420 has exceeded capacity threshold, start to calculate file to be sent memory capacity after overcompression is processed.Now do not compress, by calculation of capacity unit 610, calculate and estimate file to be sent memory capacity after overcompression is processed.
Bundling compression unit 620, when determining that the result of calculation of calculation of capacity unit 610 is more than or equal to capacity threshold, the request receiving according to receiver module 410 divide rolling compression processing to sent file.The result of calculation obtaining according to calculation of capacity unit 610, determine when file to be sent memory capacity after overcompression is processed is more than or equal to capacity threshold, bundling compression unit 620 divides rolling compression to process according to recipient's request to sent file.Particularly, capacity threshold can be adjusted into and be less than or equal to the numerical value that recipient receives file restriction, then calculation of capacity unit 610 calculates and estimates; Bundling compression unit 620 determines that according to result of calculation file to be sent memory capacity after overcompression is processed is more than or equal to capacity threshold, according to a minute method for rolling compression processing, compressing file to be sent is become to several small documents, the memory capacity of each small documents meets recipient's restriction requirement.
One of ordinary skill in the art will appreciate that all or part of flow process realizing in above-described embodiment method, to come the hardware that instruction is relevant to complete by computer program, described program can be stored in a computer read/write memory medium, this program, when carrying out, can comprise as the flow process of the embodiment of 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.
The above embodiment has only expressed several execution mode of the present invention, and it describes comparatively concrete and detailed, but can not therefore be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection range of patent of the present invention should be as the criterion with claims.