Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, completeSite preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than the embodiment of whole.It is based onEmbodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not madeEmbodiment, belongs to the scope of protection of the invention.
In the prior art, generally the MTU of Network Interface Unit is used as default, but, use as defaultThe Network Interface Unit of MTU is not necessarily suitable any network, and particular network in the transmission conditions not gone up in the same time not yetIt is identical to the greatest extent, if the MTU for arranging is not suitable for current network, the transmission performance of Network Interface Unit may be caused to decline.
For example:If the MTU of Network Interface Unit is configured to less value, data to be transmitted bag can be split into morePacket, due to being required to add corresponding packet information in each packet(Such as header etc.), therefore, increased netNetwork resource occupation amount;Further, since the data every time by Network Interface Unit transmission are less, therefore, increased transmission to be passedThe total time of transmission of data.
In order to solve the above problems, the present embodiment provides a kind of method to set up of MTU value, is applied to support to carry out with networkThe electronic equipment of data interaction, as shown in figure 1, including:
101st, electronic equipment obtains the network environment information of current network.
The data transmission performance of heterogeneous networks may be different, if the data transmission performance of network is higher, will can performThe MTU of the Network Interface Unit of data transfer is set to larger value, as such, it is possible to quickly transmission data, if the number of networkIt is relatively low according to transmission performance, then the MTU for performing the Network Interface Unit of data transfer can be set to less value, so, canIt is not dropped with ensureing data successfully can be transmitted.
In the present embodiment, electronic equipment can arrange MTU value according to the network environment information of current network, in order to for follow-upThe step of arranging MTU value is laid the groundwork, and electronic equipment can obtain the network environment information of current network first.
Electronic equipment in the present embodiment can be, but not limited to for:Mobile phone, panel computer etc..
102nd, search the MTU value of the correspondence network environment information.
Can be stored with electronic equipment MTU value corresponding with different network environments information, can search the correspondence netThe MTU value of network environmental information.
If the 103, finding the MTU value, the MTU value that the MTU of Network Interface Unit is set to find.
The MTU of Network Interface Unit is set to after MTU value corresponding with the network environment information, it is ensured that networkInterface equipment adapts to current network conditions, can efficiently be transmitted data.
After such scheme, electronic equipment obtains the network environment information for being currently located network;According to the network ringsEnvironment information searches corresponding MTU;If finding described by MTU, the MTU that the MTU of Network Interface Unit is set to find.So, electronic equipment can determine the MTU of Network Interface Unit according to current network environment, in prior art, by networkThe MTU of interface equipment uses as default and compares, and can increase the motility of MTU settings, using the network interface arranged after MTUEquipment is capable of the network of compatible difference transmission environment, so as to improve the data transmission performance of network.
The present embodiment provides the method to set up of another kind of MTU value, and methods described can apply to support to enter line number with networkAccording on interactive electronic equipment, and the method is further expanding and optimize to the method shown in Fig. 1, as shown in Fig. 2 can be withIncluding:
201st, electronic equipment receives the MTU data bases for pre-seting.
Used as an embodiment of the present embodiment, developer can be done by experiment, test etc. on streamMethod obtains the different corresponding MTU values of network environment information, and sets up MTU data bases with this, for depositing different network ringsCorresponding relation between environment information and MTU value;The MTU data bases are implanted into into electronic equipment when electronic equipment dispatches from the factory simultaneouslyIn.
Further, the method for setting up MTU data bases can include:
Roam test by way of or combine PMTU(Path MTU, path mtu)Discovery technical limit spacings from it is differentThe corresponding MTU value of network environment information, and store the different network environment information it is corresponding with the MTU value for getting closeSystem, obtains MTU data bases.
Further, the MTU data bases can also include MTU default values.
Wherein, the MTU value that the MTU default values are generally arranged in being prior art.
Wherein, the corresponding relation for being obtained between different network environment informations and MTU value by the method for roaming test canTo include:
Roaming tester tests each IP of all types of operators in roaming place(Internet Protocol, networkBetween the agreement that interconnects)The miscellaneous service of address family, so as to obtain the corresponding pass between different network environment informations and MTU valueSystem.
Can be with reference to the corresponding relation between the different network environment information of PMTU Discovery technical limit spacings and MTU valueIncluding:
By PMTU Discovery technologies, the MTU value being adapted to during the ground IP races business is found, it is different so as to obtainCorresponding relation between network environment information and MTU value.
The present embodiment is not construed as limiting to the method and PMTU Discovery technologies of roaming test, is those skilled in the artWell known technology, will not be described here.
Wherein, the MTU data bases can include the corresponding relation between different network environment informations and MTU value, instituteState at least one that network environment information can be, but not limited to include in following information:Operator types information, network type letterBreath, access point APN(Access Point Name)Protocol suite type information, APN traffic type informations or geographical location information.
Operator types information can include:China Telecom, China Mobile etc., network type information can include:2G、3GDeng access point APN protocol suites type information can include:IPV4(Internet Protocol Version4, Internet protocol versionThis 4)、IPV6(Internet Protocol Version6, IPv6)Deng APN traffic type informations can be wrappedInclude:Business of networking, MMS etc., geographical location information can include:Beijing, Shenzhen etc..
As an embodiment of the present embodiment, for subsequent content sake of clarity, now can be by a network environmentCorresponding relation between information and MTU value is referred to as a relation list item, and thus, MTU data bases can include multiple relation list items.
If any information included in network environment information is differed, MTU value corresponding with the network environment information canCan differ.
As shown in table 1, MTU data bases can be, but not limited to present in the way of table 1:
Table 1
Such as table 1 as can be seen that when electronic equipment is in different network environments and/or performs different business, will can be somebody's turn to doThe MTU of the Network Interface Unit of electronic equipment is arranged to the Network Interface Unit after different numerical value, and setting MTU and can fitFor current network environment.
The present embodiment is not construed as limiting to the content that MTU data bases include, can be set according to actual needs, not limitedContent in table 1, will not be described here.
The present embodiment to got by way of test from the method for the corresponding MTU value of different network environment informations notIt is construed as limiting, is technology well known to those skilled in the art, and can be set according to actual needs, will not be described here.
202nd, according to the operator types information, the network type information, described access point APN protocol suite type letterIn breath, the APN traffic type informations, the geographical location information, at least one information is ranked up to relation list item.
Electronic equipment can search MTU value corresponding with network environment parameters by way of traveling through MTU data bases, in order toThe step of simplifying electronic equipment traversal MTU data bases, then electronic equipment can be first according to described at least one information to MTU numbersIt is ranked up according to the relation list item in storehouse so that described at least one information identical relation list item arranged adjacent, as such, it is possible toSimplify the ergodic process of electronic equipment.
As an embodiment of the present embodiment, the method that MTU data bases are ranked up can be, but not limited to include:
First, according to operator types information to MTU data bases in each relation list item classify so that operator's classType information identical relation list item arranged adjacent, then, for operator types information identical relation list item, further according to networkType information is classified to the relation list item, makes operator types information and network type information identical relation list item adjacentArrangement, according to above-mentioned steps, can with but be not limited to again successively according to APN protocol suite type informations, the APN types of service believeIn breath, the geographical location information, at least one information is ranked up to network environment information.
Specifically, if electronic equipment is only ranked up to the relation list item in MTU data bases according to operator types information,Then the relation list item after sequence can be:Relation list item arranged adjacent of the operator types information for " China Telecom ", operatorRelation list item arranged adjacent of the type information for " China Mobile ".
The present embodiment is not construed as limiting to the sort method of MTU data bases, can be set according to actual needs, and here is notRepeat again.
For example, can be successively according to operator types information and network type information to the relation list item in MTU data basesIt is ranked up, to obtain table 2.
Table 2
203rd, the original position mark of the relation list item of at least one different information is recorded respectively.
As an embodiment of the present embodiment, as shown in table 2, it is successively according to operator types information and the netNetwork type information is ranked up to relation list item, then record the start bit of the relation list item of at least one different information respectivelyPutting mark includes:Record first includes the original position mark of " China Mobile ", the relation list item of " 2G ", as sequence number " 1 ",Record first includes the original position mark of " China Mobile ", the relation list item of " 3G ", as sequence number " p ", record firstIdentify including the original position of " China Telecom ", the relation list item of " 2G ", as sequence number " m ", record first includes " China's electricityThe original position mark of letter ", the relation list item of " 3G ", as sequence number " n ".
The present embodiment is not construed as limiting to original position mark, can be set according to actual needs, be will not be described here.
204th, the electronic equipment obtains the network environment information of current network.
Further, as electronic equipment ceaselessly may moved, so, network environment that electronic equipment is presently inMay change, therefore, electronic equipment can obtain the network environment information according to prefixed time interval, and then can protectCard can get corresponding MTU value after network environment information changes.
The present embodiment is not construed as limiting to prefixed time interval, can be set according to actual needs, e.g., can with but do not limitIn for 1 minute etc., will not be described here.
205th, at least one information information identical relation list item corresponding with the network environment information described in obtainingOriginal position mark.
As an embodiment of the present embodiment, if the network environment information that step 204 gets includes:" China movesIt is dynamic ", " 3G ", " IPV6 ", " business of networking ", " Shenzhen ", then as shown in table 2, then electronic equipment can first determine whether sequence number " 1 ",Cross in " p ", " m ", " n " corresponding relation list item and whether include " China Mobile ", " 3G ", obtain comprising " China Mobile ", " 3G "Relation list item sequence number, as " p ".
206th, corresponding relation list item is identified from the original position for getting to start to be traveled through one by one, search comprising describedThe corresponding relation list item of network environment information.If finding MTU value, execution step 207, if not finding MTU value, is performedStep 209.
As an embodiment of the present embodiment, as shown in table 2, the original position mark for getting in step 205For sequence number " p ", electronic equipment can proceed by traversal from " p " corresponding relation list item, you can find comprising network environmentThe relation list item of information.
So, the MTU data bases after to being ranked up travel through, it is possible to reduce the traversal number to relation list item,Simplify ergodic process.Specifically, electronic equipment only traversal serial number " p " to the relation list item between serial number " m ", can be wrappedInclude the relation list item of serial number " p ".
What deserves to be explained is, if the network environment information that step 204 gets is only included:" China Mobile ", " 3G ", then it is electricSub- equipment is obtained multiple relation list items comprising " China Mobile ", " 3G " after MTU data bases have been traveled through, then can be from thisA relation list item is obtained in multiple relation list items arbitrarily.
207th, read the MTU value in the corresponding relation list item
The 208th, the MTU of Network Interface Unit is set to the MTU value for finding.
As an embodiment of the present embodiment, after electronic equipment is attached with network, at least one can be configuredIndividual Network Interface Unit, at least one Network Interface Unit can correspond to different types of service respectively, e.g., MMS,Equipotential business etc..
Such as, when electronic equipment performs MMS, electronic equipment can be first looked for and be obtained and network environment informationCorresponding MTU value, wherein, the APN traffic type informations that the network environment information includes can be " MMS ", then,The MTU of MMS corresponding Network Interface Unit is set to into the MTU value for getting.
Flow process terminates.
209th, the MTU of Network Interface Unit is set to into MTU default values.
The present embodiment is not construed as limiting to MTU default values, can according to be need set, and establishing method be this areaTechnology known to technical staff, will not be described here.
It is further alternative, if electronic equipment does not find the MTU value of the correspondence network environment information, can also lead toCross the mode of roaming test or combine PMTU Discovery technical limit spacings MTU value corresponding with the network environment information, andThe MTU value that the MTU of the Network Interface Unit is set to get, or it is directly disposed as MTU default values.
210th, MTU data bases are updated.
As an embodiment of the present embodiment, if not finding from MTU data bases corresponding with network environment informationMTU value, then can also update MTU data bases, you can to add new relation list item in MTU data bases, so as to follow-upMTU value corresponding with the network environment information can be found in step.
Further, updating MTU data bases can include:
It is by way of roaming test or corresponding with the network environment information with reference to PMTU Discovery technical limit spacingsMTU value;The network environment information is added into the MTU data bases with the corresponding relation of the MTU value for getting.
If in addition, find MTU data bases there is inaccurate MTU value, can also roam test by way of or knotClose the existing MTU value of PMTU Discovery technology modification MTU data bases.
Wherein, the method by roaming test obtains MTU value corresponding with the network environment information and can specifically include:
Roaming tester tests the miscellaneous service of each IP address race of all types of operators in roaming place, so as to obtainTake MTU value corresponding with the network environment information, and by the relation list item(Between i.e. described network environment information and MTU valueCorresponding relation)It is stored in MTU data bases, to update MTU data bases.
Can include with reference to PMTU Discovery technical limit spacings MTU value corresponding with the network environment information:
By PMTU Discovery technologies, find the MTU value being adapted to during the ground IP races business, so as to obtain with it is describedThe corresponding MTU value of network environment information, and the relation list item is stored in MTU data bases, to update MTU data bases.
After such scheme, electronic equipment obtains the network environment information for being currently located network;According to the network ringsEnvironment information searches corresponding MTU;If finding described by MTU, the MTU that the MTU of Network Interface Unit is set to find.So, electronic equipment can determine the MTU of Network Interface Unit according to current network environment, in prior art, by networkThe MTU of interface equipment uses as default and compares, and can increase the motility of MTU settings, using the network interface arranged after MTUEquipment is capable of the network of compatible difference transmission environment, so as to improve the data transmission performance of network.
Specifically, electronic equipment can obtain MTU corresponding with network environment information by way of traveling through MTU data basesValue, furthermore it is also possible to be ranked up to the relation list item in MTU data bases according to network environment information, reduces electronic equipmentThe quantity of traversal relation list item, simplifies ergodic process.
In order to preferably understand to above-described embodiment, a specific example is provided below, with electronic equipmentIllustrate as a example by performing MMS.As shown in figure 3, the data interaction figure of the system logic structure for this example, the systemCan apply in electronic equipment, concrete steps can include:
1. data cube computation manager connects to network initiated data, so that electronic equipment can carry out data friendship with networkMutually;
If 2. data cube computation success, data cube computation manager configures Network Interface Unit corresponding with MMS;
3. data cube computation manager obtains the network environment information that electronic equipment is presently in from communication module;
4. data cube computation manager searches MTU value corresponding with the network environment information for getting in MTU data bases;IfMTU value, execution step 5 are found, if not finding MTU value, execution step 6;
5. the MTU of Network Interface Unit corresponding with MMS is set to the MTU for getting by data cube computation managerValue;Execution step 7;
6. the MTU of Network Interface Unit corresponding with MMS is set to MTU default values by data cube computation manager;
7. the MTU value of setting is informed TCP/IP by Network Interface Unit(Transmission Control Protocol/Internet Protocol, transmission control protocol/Internet Protocol)Protocol stack;
8.TCP/IP protocol stacks adjust the data by Network Interface Unit according to the MTU value for reporting of Network Interface UnitThe size of bag.
Some device embodiments are provided below, corresponding embodiment of the method phase of the device embodiment respectively at above-mentioned offerCorrespondence.
The present embodiment provides a kind of electronic equipment, and the electronic equipment is supported to carry out data interaction with network, such as Fig. 4 institutesShow, can include:
Acquiring unit 41, for obtaining the network environment information of current network;
Searching unit 42, for searching the MTU value of the correspondence network environment information;
Setting unit 43, if for finding the MTU value, the MTU of Network Interface Unit is set to what is foundMTU value.
After such scheme, electronic equipment obtains the network environment information for being currently located network;According to the network ringsEnvironment information searches corresponding MTU;If finding described by MTU, the MTU that the MTU of Network Interface Unit is set to find.So, electronic equipment can determine the MTU of Network Interface Unit according to current network environment, in prior art, by networkThe MTU of interface equipment uses as default and compares, and can increase the motility of MTU settings, using the network interface arranged after MTUEquipment is capable of the network of compatible difference transmission environment, so as to improve the data transmission performance of network.
The present embodiment provides another kind of electronic equipment, and the electronic equipment is the further expansion to the electronic equipment shown in Fig. 4Exhibition and optimization, as shown in figure 5, can include:
Acquiring unit 51, for obtaining the network environment information of current network;
Searching unit 52, for searching the MTU value of the correspondence network environment information;
Setting unit 53, if for finding the MTU value, the MTU of Network Interface Unit is set to what is foundMTU value.
Further, the electronic equipment that the present embodiment is provided can also include:
Receiving unit 54, for before the network environment information that the electronic equipment obtains current network, receiving defaultThe MTU data bases for putting, the MTU data bases include the corresponding relation between different network environment informations and MTU value, the netNetwork environmental information includes at least one in following information:Operator types information, network type information, access point APN agreementsRace's type information, APN traffic type informations or geographical location information;
The MTU data bases also include MTU default values.
Further, the MTU data bases that the receiving unit 54 is received are by way of roaming test or combinationPMTU Discovery technical limit spacings and the corresponding MTU value of different network environment informations, and store the different network environmentObtain after information and the corresponding relation of the MTU value for getting.
Further, the setting unit 53, if being additionally operable to not find the MTU value, the network interface is setStandby MTU is set to the MTU default values;
The electronic equipment also includes:
Updating block 55, for updating the MTU data bases.
Further, the updating block 55 includes:
Acquisition module 551, for roam test by way of or combine PMTU Discovery technical limit spacings with it is describedThe corresponding MTU value of network environment information;
Add module 552, for the network environment information and the corresponding relation of the MTU value for getting are added to describedIn MTU data bases.
After such scheme, electronic equipment obtains the network environment information for being currently located network;According to the network ringsEnvironment information searches corresponding MTU;If finding described by MTU, the MTU that the MTU of Network Interface Unit is set to find.So, electronic equipment can determine the MTU of Network Interface Unit according to current network environment, in prior art, by networkThe MTU of interface equipment uses as default and compares, and can increase the motility of MTU settings, using the network interface arranged after MTUEquipment is capable of the network of compatible difference transmission environment, so as to improve the data transmission performance of network.
Specifically, electronic equipment can obtain MTU corresponding with network environment information by way of traveling through MTU data basesValue, furthermore it is also possible to be ranked up to the relation list item in MTU data bases according to network environment information, reduces electronic equipmentThe quantity of traversal relation list item, simplifies ergodic process.
Through the above description of the embodiments, those skilled in the art can be understood that the present invention can be borrowedSoftware is helped to add the mode of required common hardware to realize, naturally it is also possible to which by hardware, but the former is more preferably in many casesEmbodiment.Based on such understanding, the portion that technical scheme is substantially contributed to prior art in other wordsDivide and can be embodied in the form of software product, the computer software product is stored in the storage medium that can read, such as countThe floppy disk of calculation machine, hard disk or CD etc., use so that a computer equipment including some instructions(Can be personal computer,Server, or the network equipment etc.)Perform the method described in each embodiment of the invention.
The above, the only specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, anyThose familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all be containedCover within protection scope of the present invention.Therefore, protection scope of the present invention described should be defined by scope of the claims.