Embodiment
First, the part noun or the term that in the process that the embodiment of the present invention is described, occur are applicable to description below:
In order to make those skilled in the art person understand better the present invention program, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the embodiment of a part of the present invention, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, should belong to the scope of protection of the invention.
It should be noted that, the term " first " in specification of the present invention and claims and above-mentioned accompanying drawing, " second " etc. are for distinguishing similar object, and needn't be for describing specific order or precedence.The data that should be appreciated that such use suitably can exchanged in situation, so as embodiments of the invention described herein can with except diagram here or describe those order enforcement.In addition, term " comprises " and " having " and their any distortion, intention is to cover not exclusive comprising, for example, those steps or unit that the process that has comprised series of steps or unit, method, system, product or equipment are not necessarily limited to clearly list, but can comprise clearly do not list or for these processes, method, product or equipment intrinsic other step or unit.
Embodiment 1
According to the embodiment of the present invention, a kind of method of file request is provided, as shown in Figure 1, the method comprises:
S102 obtains the first indication information that is used to indicate the first file to be obtained in terminal;
Alternatively, in the present embodiment the first file include but not limited to following one of at least: picture file, audio file and video file.Alternatively, above-mentioned terminal include but not limited to following one of at least: mobile phone, notebook computer, panel computer.
For example, take and obtain audio file as example by mobile phone, on mobile phone, by touch screen or key-press input, be used for obtaining first indication information (for example, audio file title " Music ") of required audio file.
S104, obtains the network speed of the current network that terminal is connected to;
Alternatively, current network includes but not limited in the present embodiment: 2G network, 3G network, WIFI network.
For example, when the network of terminal connection is 2G, network speed is 25kb/s; When the network connecting when terminal is 3G, network speed is 500kb/s; When the network connecting when terminal is WIFI, network speed is 2mb/s.
S106, according to network speed and the first indication information spanned file solicited message;
Alternatively, file request information is used for the first file mating with network speed to server request file size in the present embodiment.
For example, take and obtain audio file as example by mobile phone, suppose that the current connected network of mobile phone is WIFI, its network speed is 2mb/s, the first indication information is audio file title " Music ", according to above-mentioned network speed and the first indication information, generate corresponding file request information, the audio file that is called " Music " for the audio file name mating with network speed to server request file size, for example, high-quality (for example to server request, high-fidelity, or, harmless) audio file name be called the audio file of " Music ".
Again for example, suppose that the current connected network of mobile phone is 2G, its network speed is 25kb/s, the first indication information is audio file title " Music ", according to above-mentioned network speed and the first indication information, generate corresponding file request information, for the audio file name mating with network speed to server request file size, be called the audio file of " Music ", for example, the audio file that for example, is called " Music " to the audio file name of server request low-quality (, Lo-Fi).
S108, from terminal to server Transmit message solicited message.
Alternatively, the first file of the different file sizes that prestore in server in the present embodiment, so that the first file mating with network speed to terminal Transmit message size under different network speeds according to the request that carrys out self terminal.
For example, can the prestore audio file name of different qualities of server is called the audio file of " Music ", as has deposited the audio file that three audio file names are called " Music ", and wherein, the file size of three audio files is respectively: 8M, 3M, and 1M.
In embodiments of the present invention, by obtaining the network speed of current network, to obtain the file that file size and network speed match to server, thereby size and the unmatched technical problem of network speed of file to be obtained have been solved, like this, when network speed is slow, can the inferior file of acquisition request (for example, normal video, picture or lo-fi audio frequency that resolution is low), to improve file acquisition speed, minimizing file acquisition time; When network speed is fast, can acquisition request high-quality file (for example, the picture that HD video, resolution are high or the audio frequency of high-fidelity), to improve the quality of the file getting.
As a kind of optional scheme, as shown in Figure 2, according to network speed and the first indication information spanned file solicited message, comprise:
S202, judges whether network speed is greater than the first network speed threshold value;
For example, for example set the first network speed threshold value and be A(, 600kb/s), judge current network speed whether be greater than the first network speed threshold value be A(for example, 600kb/s), judgement is to carry out S204; If not, carry out S206.
S204, is greater than the first network speed threshold value if judge network speed, spanned file solicited message in terminal, and wherein, the first file that file size is mated with network speed is: file size is greater than the first file of the first file size threshold value.
For example, take and obtain audio file as example by mobile phone, the current connected network of mobile phone is WIFI network, its network speed is 2mb/s, and the first network speed threshold value is 600kb/s, and judgement learns that current network speed 2mb/s is greater than the first network speed threshold value 600kb/s, on mobile phone, generate corresponding audio file solicited message, for example, the audio file that for example, is called " Music " to the audio file name of server request high-quality (, high-fidelity).Wherein, the size (for example, file size is 8M) with the first file of current network speeds match, is greater than the first file size threshold value (for example, this threshold value is 5M).
S206, is less than or equal to the first network speed threshold value if judge network speed, spanned file solicited message in terminal, and wherein, the first file that file size is mated with network speed is: file size is less than or equal to the first file of the first file size threshold value.
For example, take and obtain audio file as example by mobile phone, the current connected network of mobile phone is 3G network, its network speed is 500kb/s, and the first network speed threshold value is 600kb/s, and judgement learns that current network speed 500kb/s is less than the first network speed threshold value 600kb/s, on mobile phone, generate corresponding audio file solicited message, for example, the audio file that for example, is called " Music " to the audio file name of server request ordinary quality (, medium fidelity).Wherein, the size (for example, file size is 3M) with the first file of current network speeds match, is less than the first file size threshold value (for example, this threshold value is 5M).
Shown in Fig. 3, further illustrate, take and obtain audio file as example by mobile phone, mobile phone judgement current network (for example, connected network is 3G network) network environment situation, (for example obtain current network speed, for 500kb/s), then to server, (for example pull current network speed, 500kb/s) audio frequency of lower corresponding quality (for example, file size is 3M), server to the first file of stored difference size (for example, the name that file size is different is called the audio file of " Music ") search, find after corresponding audio file, to mobile phone, return to corresponding audio-frequency information.
The embodiment providing by the application, by the network speed of judgement current network, obtain the file of the file size matching with it, when network speed is slow, can the inferior file of acquisition request (for example, normal video, picture or lo-fi audio frequency that resolution is low), to improve file acquisition speed, minimizing file acquisition time; When network speed is fast, can acquisition request high-quality file (for example, the picture that HD video, resolution are high or the audio frequency of high-fidelity), to improve the quality of the file getting, has realized according to the speed of network speed and has automatically downloaded the file adapting.
As a kind of optional scheme, as shown in Figure 4, if judge network speed, be less than or equal to the first network speed threshold value, in terminal, spanned file solicited message comprises:
S402, judgement network speed is less than or equal to the first network speed threshold value, but whether is greater than the second network speed threshold value, and wherein, the first network speed threshold value is greater than the second network speed threshold value, and the first file size threshold value is also greater than the second file size threshold value;
For example, for example set the first network speed threshold value and be A(, 600kb/s), the second network speed threshold value be B(for example, 100kb/s), wherein, the first network speed threshold value 600kb/s is greater than the second network speed threshold value 100kb/s, and the first file size threshold value corresponding with the first network speed threshold value 600kb/s is 5M, and the second file size threshold value corresponding with the second network speed threshold value 100kb/s is 2M, wherein, the first file size threshold value 5M is greater than the second file size threshold value 2M.Judgement current network speed be less than or equal to the first network speed threshold value A (for example, in situation 600kb/s), with the second network speed threshold value B(for example, magnitude relationship 100kb/s).
S404, if judging network speed is less than or equal to the first network speed threshold value but is greater than the second network speed threshold value, spanned file solicited message in terminal, wherein, the first file that file size is mated with network speed is: file size is less than or equal to the first file size threshold value and is greater than the first file of the second file size threshold value;
For example, take and obtain audio file as example by mobile phone, the current connected network of mobile phone is 3G network, its network speed is 500kb/s, the first network speed threshold value is 600kb/s, the second network speed threshold value is 100kb/s, judgement learns that current network speed 500kb/s is less than the first network speed threshold value 600kb/s, but be greater than the second network speed threshold value 100kb/s, on mobile phone, generate corresponding audio file solicited message, for example, the audio file that for example, is called " Music " to the audio file name of server request ordinary quality (, medium fidelity).Wherein, the size (for example, file size is 3M) with the first file of current network speeds match, is less than or equal to the first file size threshold value (for example, this threshold value is 5M), and is greater than the second file size threshold value (for example, this threshold value is 2M).
S406, is less than or equal to the second network speed threshold value if judge network speed, spanned file solicited message in terminal, and wherein, the first file that file size is mated with network speed is: file size is less than or equal to the first file of the second file size threshold value;
For example, take and obtain audio file as example by mobile phone, the current connected network of mobile phone becomes 2G network, its network speed is 25kb/s, the first network speed threshold value is 600kb/s, the second network speed threshold value is 100kb/s, judgement learns that current network speed 25kb/s is less than the first network speed threshold value 600kb/s, also be less than the second network speed threshold value 100kb/s, on mobile phone, generate corresponding audio file solicited message, for example, the audio file that for example, is called " Music " to the audio file name of server request low-quality (, Lo-Fi).Wherein, the size (for example, file size is 1M) with the first file of current network speeds match, is less than or equal to the first file size threshold value (for example, this threshold value is 5M), is also less than the second file size threshold value (for example, this threshold value is 2M).
By the application's embodiment, in the situation that network speed is less than or equal to the first network speed threshold value, the magnitude relationship of judgement current network speed and the second network speed threshold value, and then network environment is further distinguished, when network speed is slow, can the inferior file of acquisition request, to improve file acquisition speed, reduce the file acquisition time.
As a kind of optional scheme, after terminal to server Transmit message solicited message, the first file that terminal receives server transmission comprises three kinds of optional execution modes:
As a kind of optional execution mode, if network speed is greater than the first network speed threshold value, in terminal, receive the first file that server sends, wherein, the file size of the first file is greater than or less than and equals the first file size threshold value;
For example, shown in Fig. 3, take and obtain audio file as example by mobile phone, the current connected network of mobile phone is WIFI network, its network speed is 2mb/s, the first network speed threshold value is 600kb/s, be that current network speed is greater than the first network speed threshold value, server for example, by the file size matching with this network speed (, the first file 8M) (for example, name is called the audio file of " Music ") search, the audio file adapting if find, return to the audio-frequency information matching, for example, file size is that the name of 8M is called the audio file of " Music ", if do not find the audio file adapting, return to next quality (for example, network speed equal'ss the first network speed threshold value 600kb/s) audio-frequency information, for example, the name that file size is 5M is called the audio file of " Music ".
As the optional execution mode of another kind, if network speed is less than or equal to the first network speed threshold value and is greater than the second network speed threshold value, in terminal, receive the first file that server sends, wherein, the file size of the first file is less than or equal to the first file size threshold value and is greater than the second file size threshold value, or, be less than or equal to the second file size threshold value;
For example, shown in Fig. 3, take and obtain audio file as example by mobile phone, the current connected network of mobile phone is 3G network, its network speed is 500kb/s, the first network speed threshold value is 600kb/s, the second network speed threshold value is 100kb/s, be that current network speed is less than the first network speed threshold value, and be greater than the second network speed threshold value, server for example, by the file size matching with this network speed (, the first file 3M) (for example, name is called the audio file of " Music ") search, the audio file adapting if find, return to the audio-frequency information matching, for example, file size is that the name of 3M is called the audio file of " Music ", if do not find the audio file adapting, return to next quality (for example, network speed equal'ss the second network speed threshold value 100kb/s) audio-frequency information, for example, the name that file size is 2M is called the audio file of " Music ".
As another optional execution mode, if network speed is less than or equal to the second network speed threshold value, in terminal, receive the first file that server sends, wherein, the file size of the first file is less than or equal to the second file size threshold value.
For example, shown in Fig. 3, take and obtain audio file as example by mobile phone, the current connected network of mobile phone becomes 2G network, its network speed is 25kb/s, the first network speed threshold value is 600kb/s, the second network speed threshold value is 100kb/s, be that current network speed is less than the first network speed threshold value, also be less than the second network speed threshold value, server for example, by the file size matching with this network speed (, the first file 1M) (for example, name is called the audio file of " Music ") search, the audio file adapting if find, return to the audio-frequency information matching, for example, file size is that the name of 1M is called the audio file of " Music ".
The embodiment providing by the application, according to current network situation, obtains the file of different file sizes to server, if server finds the file matching and exists, return to the file adapting, if do not exist, reduce the quality of file, return to the file lower than request condition.
As a kind of optional scheme, after terminal to server Transmit message solicited message, also comprise: in terminal, receive the first file that file size that server sends is mated with network speed, or, receive the response message of obtaining failure that is used to indicate of server transmission.
For example, take and obtain audio file as example by mobile phone, the current connected network of mobile phone is 3G network, its network speed is 500kb/s, from mobile phone after server Transmit message solicited message, for example, if whois lookup (obtains the first file of matching with current network speed, name is called the audio file of " Music "), to mobile phone, return to the audio-frequency information matching, for example, the name that file size is 3M is called the audio file of " Music "; If server does not find the first file matching with current network speed, for example, name is called the audio file of " Music ", does not also find the file of next quality, and mobile phone obtains the response message of failure by receiving server.
The embodiment providing by the application, if server finds the file matching with current network speed, returns to the fileinfo adapting, yet, if do not find the file matching, will make the response of obtaining failure, realized according to user's request the online service adapting is provided.
As a kind of optional scheme, before obtaining the network speed of the current network that terminal is connected to, also comprise:
S1, judges whether to get in terminal the second indication information that is used to indicate adaptive network reception file;
Alternatively, increase the function of an adaptive network in Webpage, by the second indication information of switching is set, indicate whether to use the function of adaptive network, whether judgement terminal (for example, mobile phone) gets the second indication information.
S2, if after getting the second indication information, notifies and in terminal, carries out following steps: the network speed that obtains the current network that terminal is connected to; According to network speed and the first indication information spanned file solicited message; From terminal to server Transmit message solicited message.
For example, shown in Fig. 5, if select in the situation of adaptive network function unlatching, notify mobile phone can obtain according to network condition self adaptation the file of corresponding quality, the concrete following steps of carrying out: (for example obtain current network that mobile phone is connected to, WIFI network) network speed (for example, 2mb/s); For example, for example, according to network speed (, 2mb/s) He the first indication information (, name is called the audio file of " Music ") spanned file solicited message; By mobile phone, to server Transmit message solicited message, for example, for example, to the audio file name of server request high-quality (, high-fidelity), be called the audio file of " Music ".
Whether the embodiment providing by the application, by adaptive network function is set, can obtain according to current network speed the file adapting by real-time selection, makes user obtain better user and experience.
It should be noted that, for aforesaid each embodiment of the method, for simple description, therefore it is all expressed as to a series of combination of actions, but those skilled in the art should know, the present invention is not subject to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in specification all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that can add essential general hardware platform by software according to the method for above-described embodiment and realize, can certainly pass through hardware, but in a lot of situation, the former is better execution mode.Understanding based on such, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in a storage medium (as ROM/RAM, magnetic disc, CD), comprise that some instructions are with so that a station terminal equipment (can be mobile phone, computer, server, or the network equipment etc.) carry out the method for each embodiment of the present invention.
Embodiment 2
According to the embodiment of the present invention, also provide a kind of for implementing the device of above-mentioned file request, as shown in Figure 6, this device comprises:
1) the first acquiring unit 602, for obtaining first indication information of indicating the first file to be obtained in terminal;
Alternatively, in the present embodiment the first file include but not limited to following one of at least: picture file, audio file and video file.Alternatively, above-mentioned terminal include but not limited to following one of at least: mobile phone, notebook computer, panel computer.
For example, take and obtain audio file as example by mobile phone, on mobile phone, by touch screen or key-press input, be used for obtaining first indication information (for example, audio file title " Music ") of required audio file.
2) second acquisition unit 604, for obtaining the network speed of the current network that terminal is connected to;
Alternatively, current network includes but not limited in the present embodiment: 2G network, 3G network, WIFI network.
For example, when the network of terminal connection is 2G, network speed is 25kb/s; When the network connecting when terminal is 3G, network speed is 500kb/s; When the network connecting when terminal is WIFI, network speed is 2mb/s.
3) generation unit 606, for according to network speed and the first indication information spanned file solicited message, wherein, first file of file request information for mating with network speed to server request file size;
Alternatively, file request information is used for the first file mating with network speed to server request file size in the present embodiment.
For example, take and obtain audio file as example by mobile phone, suppose that the current connected network of mobile phone is WIFI, its network speed is 2mb/s, the first indication information is audio file title " Music ", according to above-mentioned network speed and the first indication information, generate corresponding file request information, the audio file that is called " Music " for the audio file name mating with network speed to server request file size, for example, high-quality (for example to server request, high-fidelity, or, harmless) audio file name be called the audio file of " Music ".
Again for example, suppose that the current connected network of mobile phone is 2G, its network speed is 25kb/s, the first indication information is audio file title " Music ", according to above-mentioned network speed and the first indication information, generate corresponding file request information, for the audio file name mating with network speed to server request file size, be called the audio file of " Music ", for example, the audio file that for example, is called " Music " to the audio file name of server request low-quality (, Lo-Fi).
4) transmitting element 608, for from terminal to server Transmit message solicited message.
Alternatively, the first file of the different file sizes that prestore in server in the present embodiment, so that the first file mating with network speed to terminal Transmit message size under different network speeds according to the request that carrys out self terminal.
For example, can the prestore audio file name of different qualities of server is called the audio file of " Music ", as has deposited the audio file that three audio file names are called " Music ", and wherein, the file size of three audio files is respectively: 8M, 3M, and 1M.
In embodiments of the present invention, by obtaining the network speed of current network, to obtain the file that file size and network speed match to server, thereby size and the unmatched technical problem of network speed of file to be obtained have been solved, like this, when network speed is slow, can the inferior file of acquisition request (for example, normal video, picture or lo-fi audio frequency that resolution is low), to improve file acquisition speed, minimizing file acquisition time; When network speed is fast, can acquisition request high-quality file (for example, the picture that HD video, resolution are high or the audio frequency of high-fidelity), to improve the quality of the file getting.
As a kind of optional scheme, as shown in Figure 7, generation unit 606 comprises:
1) judge module 702, for judging whether network speed is greater than the first network speed threshold value;
For example, for example set the first network speed threshold value and be A(, 600kb/s), judge current network speed whether be greater than the first network speed threshold value be A(for example, 600kb/s).
2) the first generation module 704, while being greater than the first network speed threshold value for judging network speed at judge module, spanned file solicited message in terminal, wherein, the first file that file size is mated with network speed is: file size is greater than the first file of the first file size threshold value;
For example, take and obtain audio file as example by mobile phone, the current connected network of mobile phone is WIFI network, its network speed is 2mb/s, and the first network speed threshold value is 600kb/s, and judgement learns that current network speed 2mb/s is greater than the first network speed threshold value 600kb/s, on mobile phone, generate corresponding audio file solicited message, for example, the audio file that for example, is called " Music " to the audio file name of server request high-quality (, high-fidelity).Wherein, the size (for example, file size is 8M) with the first file of current network speeds match, is greater than the first file size threshold value (for example, this threshold value is 5M).
3) the second generation module 706, while being less than or equal to the first network speed threshold value for judging network speed at judge module, spanned file solicited message in terminal, wherein, the first file that file size is mated with network speed is: file size is less than or equal to the first file of the first file size threshold value.
For example, take and obtain audio file as example by mobile phone, the current connected network of mobile phone is 3G network, its network speed is 500kb/s, and the first network speed threshold value is 600kb/s, and judgement learns that current network speed 500kb/s is less than the first network speed threshold value 600kb/s, on mobile phone, generate corresponding audio file solicited message, for example, the audio file that for example, is called " Music " to the audio file name of server request ordinary quality (, medium fidelity).Wherein, the size (for example, file size is 3M) with the first file of current network speeds match, is less than the first file size threshold value (for example, this threshold value is 5M).
Shown in Fig. 3, further illustrate, take and obtain audio file as example by mobile phone, mobile phone judgement current network (for example, connected network is 3G network) network environment situation, (for example obtain current network speed, for 500kb/s), then to server, (for example pull current network speed, 500kb/s) audio frequency of lower corresponding quality (for example, file size is 3M), server to the first file of stored difference size (for example, the name that file size is different is called the audio file of " Music ") search, find after corresponding audio file, to mobile phone, return to corresponding audio-frequency information.
The embodiment providing by the application, by the network speed of judgement current network, obtain the file of the file size matching with it, when network speed is slow, can the inferior file of acquisition request (for example, normal video, picture or lo-fi audio frequency that resolution is low), to improve file acquisition speed, minimizing file acquisition time; When network speed is fast, can acquisition request high-quality file (for example, the picture that HD video, resolution are high or the audio frequency of high-fidelity), to improve the quality of the file getting, has realized according to the speed of network speed and has automatically downloaded the file adapting.
As a kind of optional scheme, as shown in Figure 8, the second generation module 706 comprises:
1) judgement submodule 802, while being less than or equal to the first network speed threshold value for judge network speed at judge module, judges whether network speed is greater than the second network speed threshold value;
Alternatively, the first network speed threshold value is greater than the second network speed threshold value in the present embodiment, and the first file size threshold value is greater than the second file size threshold value.
For example, for example set the first network speed threshold value and be A(, 600kb/s), the second network speed threshold value be B(for example, 100kb/s), wherein, the first network speed threshold value 600kb/s is greater than the second network speed threshold value 100kb/s, and the first file size threshold value corresponding with the first network speed threshold value 600kb/s is 5M, and the second file size threshold value corresponding with the second network speed threshold value 100kb/s is 2M, wherein, the first file size threshold value 5M is greater than the second file size threshold value 2M.Judgement current network speed be less than or equal to the first network speed threshold value A (for example, in situation 600kb/s), with the second network speed threshold value B(for example, magnitude relationship 100kb/s).
2) first generate submodule 804, when being less than or equal to the first network speed threshold value but being greater than the second network speed threshold value for judging network speed at judgement submodule, spanned file solicited message in terminal, wherein, the first file that file size is mated with network speed is: file size is less than or equal to the first file size threshold value and is greater than the first file of the second file size threshold value;
For example, take and obtain audio file as example by mobile phone, the current connected network of mobile phone is 3G network, its network speed is 500kb/s, the first network speed threshold value is 600kb/s, the second network speed threshold value is 100kb/s, judgement learns that current network speed 500kb/s is less than the first network speed threshold value 600kb/s, but be greater than the second network speed threshold value 100kb/s, on mobile phone, generate corresponding audio file solicited message, for example, the audio file that for example, is called " Music " to the audio file name of server request ordinary quality (, medium fidelity).Wherein, the size (for example, file size is 3M) with the first file of current network speeds match, is less than or equal to the first file size threshold value (for example, this threshold value is 5M), and is greater than the second file size threshold value (for example, this threshold value is 2M).
3) second generate submodule 806, while being less than or equal to the second network speed threshold value for judging network speed at judgement submodule, spanned file solicited message in terminal, wherein, the first file that file size is mated with network speed is: file size is less than or equal to the first file of the second file size threshold value.
For example, take and obtain audio file as example by mobile phone, the current connected network of mobile phone becomes 2G network, its network speed is 25kb/s, the first network speed threshold value is 600kb/s, the second network speed threshold value is 100kb/s, judgement learns that current network speed 25kb/s is less than the first network speed threshold value 600kb/s, also be less than the second network speed threshold value 100kb/s, on mobile phone, generate corresponding audio file solicited message, for example, the audio file that for example, is called " Music " to the audio file name of server request low-quality (, Lo-Fi).Wherein, the size (for example, file size is 1M) with the first file of current network speeds match, is less than or equal to the first file size threshold value (for example, this threshold value is 5M), is also less than the second file size threshold value (for example, this threshold value is 2M).
By the application's embodiment, in the situation that network speed is less than or equal to the first network speed threshold value, the magnitude relationship of judgement current network speed and the second network speed threshold value, and then network environment is further distinguished, when network speed is slow, can the inferior file of acquisition request, to improve file acquisition speed, reduce the file acquisition time.
As a kind of optional scheme, this device also comprises:
1) the first receiving element, for when network speed is greater than the first network speed threshold value, at transmitting element after terminal to server Transmit message solicited message, in terminal, receive the first file that server sends, wherein, the file size of the first file is greater than or less than and equals the first file size threshold value;
For example, shown in Fig. 3, take and obtain audio file as example by mobile phone, the current connected network of mobile phone is WIFI network, its network speed is 2mb/s, the first network speed threshold value is 600kb/s, be that current network speed is greater than the first network speed threshold value, server for example, by the file size matching with this network speed (, the first file 8M) (for example, name is called the audio file of " Music ") search, the audio file adapting if find, return to the audio-frequency information matching, for example, file size is that the name of 8M is called the audio file of " Music ", if do not find the audio file adapting, return to next quality (for example, network speed equal'ss the first network speed threshold value 600kb/s) audio-frequency information, for example, the name that file size is 5M is called the audio file of " Music ".
2) the second receiving element, for when network speed is less than or equal to the first network speed threshold value and is greater than the second network speed threshold value, at transmitting element after terminal to server Transmit message solicited message, in terminal, receive the first file that server sends, wherein, the file size of the first file is less than or equal to the first file size threshold value and is greater than the second file size threshold value, or, be less than or equal to the second file size threshold value;
For example, shown in Fig. 3, take and obtain audio file as example by mobile phone, the current connected network of mobile phone is 3G network, its network speed is 500kb/s, the first network speed threshold value is 600kb/s, the second network speed threshold value is 100kb/s, be that current network speed is less than the first network speed threshold value, and be greater than the second network speed threshold value, server for example, by the file size matching with this network speed (, the first file 3M) (for example, name is called the audio file of " Music ") search, the audio file adapting if find, return to the audio-frequency information matching, for example, file size is that the name of 3M is called the audio file of " Music ", if do not find the audio file adapting, return to next quality (for example, network speed equal'ss the second network speed threshold value 100kb/s) audio-frequency information, for example, the name that file size is 2M is called the audio file of " Music ".
3) the 3rd receiving element, for when network speed is less than or equal to the second network speed threshold value, at transmitting element after terminal to server Transmit message solicited message, in terminal, receive the first file that server sends, wherein, the file size of the first file is less than or equal to the second file size threshold value.
For example, shown in Fig. 3, take and obtain audio file as example by mobile phone, the current connected network of mobile phone becomes 2G network, its network speed is 25kb/s, the first network speed threshold value is 600kb/s, the second network speed threshold value is 100kb/s, be that current network speed is less than the first network speed threshold value, also be less than the second network speed threshold value, server for example, by the file size matching with this network speed (, the first file 1M) (for example, name is called the audio file of " Music ") search, the audio file adapting if find, return to the audio-frequency information matching, for example, file size is that the name of 1M is called the audio file of " Music ".
The embodiment providing by the application, according to current network situation, obtains the file of different file sizes to server, if server finds the file matching and exists, return to the file adapting, if do not exist, reduce the quality of file, return to the file lower than request condition.
As a kind of optional scheme, this device also comprises:
1) the 4th receiving element for after terminal to server Transmit message solicited message, receives the first file that file size that server sends is mated with network speed in terminal, or
2) the 5th receiving element, for after terminal to server Transmit message solicited message, receives the response message of obtaining failure that is used to indicate of server transmission.
For example, take and obtain audio file as example by mobile phone, the current connected network of mobile phone is 3G network, its network speed is 500kb/s, from mobile phone after server Transmit message solicited message, for example, if whois lookup (obtains the first file of matching with current network speed, name is called the audio file of " Music "), to mobile phone, return to the audio-frequency information matching, for example, the name that file size is 3M is called the audio file of " Music "; If server does not find the first file matching with current network speed, for example, name is called the audio file of " Music ", does not also find the file of next quality, and mobile phone obtains the response message of failure by receiving server.
The embodiment providing by the application, if server finds the file matching with current network speed, returns to the fileinfo adapting, yet, if do not find the file matching, will make the response of obtaining failure, realized according to user's request the online service adapting is provided.
As a kind of optional scheme, this device also comprises:
1) judging unit, for before obtaining the network speed of the current network that terminal is connected to, judges whether to get in terminal and is used to indicate the second indication information that adaptive network receives file;
Alternatively, increase the function of an adaptive network in Webpage, by the second indication information of switching is set, indicate whether to use the function of adaptive network, whether judgement terminal (for example, mobile phone) gets the second indication information.
2) notification unit, while getting the second indication information for judging at judging unit, notice second acquisition unit is carried out the step of the network speed obtain the current network that terminal is connected to, notice generation unit is carried out according to the step of network speed and the first indication information spanned file solicited message, and notice is from the step of terminal to server Transmit message solicited message.
For example, shown in Fig. 5, if select in the situation of adaptive network function unlatching, notify mobile phone can obtain according to network condition self adaptation the file of corresponding quality, the concrete following steps of carrying out: (for example obtain current network that mobile phone is connected to, WIFI network) network speed (for example, 2mb/s); For example, for example, according to network speed (, 2mb/s) He the first indication information (, name is called the audio file of " Music ") spanned file solicited message; By mobile phone, to server Transmit message solicited message, for example, for example, to the audio file name of server request high-quality (, high-fidelity), be called the audio file of " Music ".
Whether the embodiment providing by the application, by adaptive network function is set, can obtain according to current network speed the file adapting by real-time selection, makes user obtain better user and experience.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
In the above embodiment of the present invention, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part of detailed description, can be referring to the associated description of other embodiment.
In the several embodiment that provide in the application, should be understood that disclosed client can realize by another way.Wherein, device embodiment described above is only schematic, the for example division of unit, be only that a kind of logic function is divided, during actual realization, can there is other dividing mode, for example a plurality of unit or assembly can in conjunction with or can be integrated into another system, or some features can ignore, or do not carry out.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, the indirect coupling of unit or module or communication connection can be electrical or other form.
Unit as separating component explanation can or can not be also physically to separate, and the parts that show as unit can be or can not be also physical locations, can be positioned at a place, or also can be distributed in a plurality of network element.Can select according to the actual needs some or all of unit wherein to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can be also that the independent physics of unit exists, and also can be integrated in a unit two or more unit.Above-mentioned integrated unit both can adopt the form of hardware to realize, and also can adopt the form of SFU software functional unit to realize.
If the form of SFU software functional unit of usining integrated unit realizes and during as production marketing independently or use, can be stored in a computer read/write memory medium.Understanding based on such, the all or part of of the part that technical scheme of the present invention contributes to prior art in essence in other words or this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprises that some instructions are used so that a computer equipment (can be personal computer, server or the network equipment etc.) is carried out all or part of step of each embodiment method of the present invention.And aforesaid storage medium comprises: various media that can be program code stored such as USB flash disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), portable hard drive, magnetic disc or CDs.
Below be only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.