Detailed description of the invention
Embodiments herein is described below in detail, and the example of described embodiment is shown in the drawings, and the most same or similar label represents same or similar element or has the element of same or like function.The embodiment described below with reference to accompanying drawing is exemplary, is only used for explaining the application, and it is not intended that restriction to the application.
In the description of the present application, it will be appreciated that, term " " center ", " longitudinally ", " laterally ", on " ", D score, " front ", " afterwards ", " left ", " right ", " vertically ", " level ", " push up ", " end ", " interior ", orientation or the position relationship of the instruction such as " outward " are based on orientation shown in the drawings or position relationship, it is for only for ease of description the application and simplifies description, rather than indicate or imply that the device of indication or element must have specific orientation, with specific azimuth configuration and operation, therefore it is not intended that restriction to the application.Additionally, term " first ", " second " are only used for describing purpose, and it is not intended that instruction or hint relative importance.
In the description of the present application, it should be noted that unless otherwise clearly defined and limited, term " is installed ", " being connected ", " connection " should be interpreted broadly, and connects for example, it may be fixing, it is also possible to be to removably connect, or be integrally connected;Can be to be mechanically connected, it is also possible to be electrical connection;Can be to be joined directly together, it is also possible to be indirectly connected to by intermediary, can be the connection of two element internals.For the ordinary skill in the art, above-mentioned term concrete meaning in this application can be understood with concrete condition.
Below with reference to the accompanying drawings describe the flow according to the embodiment of the present application and use abnormal detection method, device and terminal.
Fig. 1 is the flow chart that the flow according to one embodiment of the application uses abnormal detection method.As it is shown in figure 1, use abnormal detection method according to the flow of the embodiment of the present application, including:
S101, obtains the title of the wireless network that terminal is accessed.
Specifically, when terminal accesses wireless network, the title of the current wireless network connected can be obtained by the operating system interface of terminal.
S102, verifies the title of wireless network, to judge the type of wireless network.
In an embodiment of the application, user can set up focus by inputting hotspot name and focus credit password in the mobile terminal with focus function, opens focus function, provides wireless network for other-end equipment.The hotspot name (the namely original title of the wireless network that this focus provides) of user setup can be obtained by the operating system interface of mobile terminal, and in hotspot name, add check bit according to default verification rule, obtain new hotspot name, and new hotspot name is supplied to other-end equipment as the title of wireless network.Other-end equipment can access this wireless network according to this wireless network name and corresponding credit password.Thus, the type of wireless network can be judged according to whether the title of wireless network has check bit, if there being check bit, then show during this wireless network, to move data conversion class wireless network, i.e. by the focus function of mobile terminal, GPRS, 2G, 3G or 4G network signal is converted to the wireless network that WIFI signal obtains.
Wherein, preset rules includes when original title according to wireless network generates the rule (such as the quantity of check code in the check bit that generates, the algorithm etc. that generates check code) of check bit and generates the verification title of wireless network, the original title of wireless network and the compound mode of check bit.Such as, the quantity of check code can be set to random natural number, such as 3,4,5 etc., the original title of wireless network and the compound mode of check bit can be combination front and back (original title in front check bit rear), rear before combination (original title in rear check bit front) or combined crosswise or other modes, this is not limited by the application.
Thus, in embodiments herein, can determine whether whether the title of wireless network meets the verification rule preset, if the title of wireless network meets default verification rule, then judge that wireless network is as mobile data conversion class wireless network.
Wherein, as shown in Figure 2, it is judged that whether the title of wireless network meets the verification rule preset includes:
S201, extracts the original title of wireless network from the title of wireless network according to default verification rule.
Specifically, in an embodiment of the application, the original title extracting wireless network according to default verification rule from the title of wireless network includes: determine the quantity of the check code that check bit comprises in the title of wireless network and the position relationship of the original title of check bit and wireless network according to default verification rule;Quantity according to check code and position relationship determine non-check code character string in the title of wireless network, and using non-check code character string as the original title of wireless network.
For example, in the verification rule settings check bit preset, the quantity of check code is 3, the original title of wireless network and the compound mode of check bit are that (original title is front in combination front and back, check bit is rear), then for title ABCC6R of wireless network, the primitive name that can extract wireless network is referred to as ABC.
S202, verification rule and wireless network original title generate verification title.
Specifically, in an embodiment of the application, first using n character in original title successively as front n the character in verification title, then by the check bit in following cyclic check rule-based algorithm calculating verification title:
Wherein, k ∈ 1 ... N, N are the quantity of check code in check bit, n is the string length of original title, Rn+kFor kth check bit in verification title, Q is the number of default available check code, and wherein, the number of available check code is prime number.
For example, the available check code preset can be 37 shown in table 1, as shown in table 1 including 10 Arabic numerals, 26 English alphabets and " * ", i.e. Q=37, each available check code and numerical value corresponding during calculating thereof.
Table 1
0(0) |
1(1) |
2(2) |
3(3) |
4(4) |
5(5) |
6(6) |
7(7) |
8(8) |
9(9) |
10(*) |
11(A) |
12(B) |
13(C) |
14(D) |
15(E) |
16(F) |
17(G) |
18(H) |
19(I) |
20(G) |
21(K) |
22(L) |
23(M) |
24(N) |
25(O) |
26(P) |
27(Q) |
28(R) |
29(S) |
30(T) |
31(U) |
32(V) |
33(W) |
34(X) |
35(Y) |
36(Z) |
|
|
|
S203, it is judged that the title of wireless network is the most consistent with verification title.
S204, if the title of wireless network is consistent with verification title, then judges that the title of wireless network meets default verification rule.
S205, if the title of wireless network is inconsistent with verification title, then judges the verification rule that the title of wireless network is unsatisfactory for presetting.
For example, default verification rule to set in check bit the quantity of check code as 3, i.e. N=3, and as a example by the compound mode of the original title of wireless network and check bit is combination front and back: for original title ABC of a wireless network, according to available check bit C6R of the algorithmic formula (1) in above-mentioned verification rule, the then entitled ABCC6R of the wireless network finally given.In like manner, as the entitled ABCC6R of the wireless network that terminal unit accesses, can according to default verification Rule Extraction go out wireless network original title ABC (according to default verification rule remove below 3 obtain), can pass through formula (1) being calculated check bit corresponding to original title ABC is C6R, and be combined as verifying title ABCC6R by check bit and original title, consistent with the title of the wireless network accessed, then judge that the title of wireless network meets default verification rule, and can determine that wireless network is mobile data conversion class wireless network.
It is to be understood that, above-mentioned default verification rule once sets, the hotspot name that all terminals all set according to user according to this verification rule when creating wireless network focus (i.e. WIFI hot spot) generates a new wireless network name, the wireless network accessed, when accessing a wireless network, is all identified by all terminals by this verification rule.Wherein, in check bit, quantity N of check code may be set to random natural number, and fault-tolerance when the type of wireless network is carried out the most greatly by the numerical value of N by this verification rule, reliability are the highest.For example, if N is set as 5, i.e. preset verification 5 check bit of rule settings, then the title of a random wireless network meets this probability presetting verification rule is 1/375≈2/100000000.This shows by this verification rule by the mobile data that are mistakenly identified as of the type of wireless network, to change the probability of class be 2/100000000ths.Therefore, the embodiment of the present application can automatically identify the type of the wireless network being currently accessed when terminal accesses wireless network, and fault-tolerance be very strong, reliability is the highest.
S103, if wireless network is mobile data conversion class wireless network, then the flow used terminal is monitored.
Specifically, in embodiments herein, can the flow that used in each Preset Time of real-time monitoring terminal.Wherein, Preset Time can be 10 seconds, 1 second, 1 millisecond etc., can be according to monitoring accuracy demand and terminator requirements set, and this is not limited by the application.
S104, when the flow that terminal uses in Preset Time is more than preset flow threshold value, it is determined that the flow of terminal uses abnormal.
In an embodiment of the application; if it is determined that the flow of terminal uses abnormal; then can carry out Traffic Anomaly prompting or disconnection of wireless network connects; can the user of prompt terminal timely; so that user takes appropriate measures (as disconnected flow or closing big flow application etc.); or disconnection of wireless network connects automatically, thus avoid excessively using or waste of flow, it is achieved that the traffic protection to the mobile terminal providing wireless network.
The flow of the embodiment of the present application uses abnormal detection method, by obtaining the title of the wireless network that terminal is accessed, and the title of this wireless network is verified, to judge the type of wireless network, and be monitored by moving flow when data change class wireless network, terminal used at wireless network, when being more than preset flow threshold value with the flow used in Preset Time in terminal, judge that the flow of terminal uses abnormal, the type of wireless network can be identified exactly, targetedly mobile data conversion class wireless network is carried out flow analysis and statistics, it is thus possible to accordingly the mobile terminal providing wireless network is carried out traffic protection.The program is high to the identification certainty of the type of wireless network such that it is able to effectively prevent flow waste or the consequence of snowslide excessively using flow to cause because mobile data conversion class wireless network cannot be recognized accurately.
Further, the scheme of the embodiment of the present application and correlation technique identify that whether the wireless network of access is that the contrast of mobile data conversion class wireless network can be as shown in table 2 by the way of credit confirms and with the mode of mobile phone wireless network ip address.It can thus be seen that the scheme of the embodiment of the present application is for the scheme in correlation technique, can automatically identify the type of wireless network, and reliability participation high, artificial is low, be relatively easy realization.
The scheme of table 2 the embodiment of the present application and the scheme comparison's relation table in correlation technique
Alternatively, in an embodiment of the application, may also include the step obtaining preset flow threshold value.Specifically, as it is shown on figure 3, obtain preset flow threshold value and include:
S301, obtains the flow confidence interval of terminal according to the confidence interval monitoring model pre-build.
Owing to terminal is when accessing the wireless network that focus provides, the consumption to flow is generally focused in the interval range of, and use flow is crossed high situation and seldom occurred.From overall angle, terminal uses flow to substantially conform to a normal distribution when accessing the wireless network that focus provides.The schematic diagram of the curve of this normal distribution can as shown in Figure 4, and wherein, transverse axis x represents the use flow of terminal, and longitudinal axis f (x) represents the probability density using flow of terminal, and α is this scale parameter being distributed the most very much.
Therefore, the population mean of sample variance and normal distribution on the basic model of normal distribution, can be utilized, obtain a confidence interval monitoring model according to confidence level.Then, the flow confidence interval of terminal is obtained according to this confidence interval monitoring model.
Specifically, if the data traffic that terminal uses in i-th Preset Time is Qi, the total flow used in front i Preset Time is Ti, then the average discharge used in front i Preset Time isThen,
When through n Preset Time, in a new Preset Time, there is following discharge relation:
Tn+1=Tn+Qi, and
From the foregoing, it will be observed that the sample variance for the flow in n Preset Time is:
Definition according to sample variance with sample standard deviation can obtain, and the sample standard deviation of the flow in n Preset Time is:
And then the standard deviation of sample average can be can get according to normal distribution mean value computation relation and be
Then according to sample average standard deviation and normal distribution, obtaining confidence interval monitoring model is:
Wherein, α is confidence level,Can be obtained by the standard normal distribution table inquiry that inquiry confidence alpha is corresponding.
Thus, can according to actual monitoring to terminal access wireless network time flow service condition obtain terminal flow use sample average and sample average standard deviation, and bring in the monitoring model of above-mentioned confidence interval, obtain the flow confidence interval of the different confidence levels of terminal.
S302, determines preset flow threshold value according to the upper limit of flow confidence interval.
For example, preset flow threshold value can be that the terminal arrived according to the actual monitoring flow service condition when accessing wireless network is calculatedValue.
If the flow that terminal uses is more than preset flow threshold value, then shows that flow service condition now is the small probability time, belong to abnormal conditions, therefore, can determine that and use extremely into flow.
Thus, according to determined by said method flow threshold to judge whether to occur that flow uses abnormal, improve flow and use accuracy and the reliability of abnormality detection.
In order to realize above-described embodiment, the application also proposes a kind of flow and uses abnormal detection device.
Fig. 5 is the structural representation that the flow according to one embodiment of the application uses abnormal detection device.
As it is shown in figure 5, use abnormal detection device according to the flow of the embodiment of the present application, including: the first acquisition module 10, correction verification module 20, monitoring modular 30 and determination module 40.
Specifically, the first acquisition module 10 is for obtaining the title of the wireless network that terminal is accessed.More specifically, when terminal accesses wireless network, the first acquisition module 10 can obtain the title of the current wireless network connected by the operating system interface of terminal.
Correction verification module 20 is for verifying the title of wireless network, to judge the type of wireless network.
In an embodiment of the application, user can set up focus by inputting hotspot name and focus credit password in the mobile terminal with focus function, opens focus function, provides wireless network for other-end equipment.The hotspot name (the namely original title of the wireless network that this focus provides) of user setup can be obtained by the operating system interface of mobile terminal, and in hotspot name, add check bit according to default verification rule, obtain new hotspot name, and new hotspot name is supplied to other-end equipment as the title of wireless network.Other-end equipment can access this wireless network according to this wireless network name and corresponding credit password.Thus, the type of wireless network can be judged according to whether the title of wireless network has check bit, if there being check bit, then show during this wireless network, to move data conversion class wireless network, i.e. by the focus function of mobile terminal, GPRS, 2G, 3G or 4G network signal is converted to the wireless network that WIFI signal obtains.
Wherein, preset rules includes when original title according to wireless network generates the rule (such as the quantity of check code in the check bit that generates, the algorithm etc. that generates check code) of check bit and generates the verification title of wireless network, the original title of wireless network and the compound mode of check bit.Such as, the quantity of check code can be set to random natural number, such as 3,4,5 etc., the original title of wireless network and the compound mode of check bit can be combination front and back (original title in front check bit rear), rear before combination (original title in rear check bit front) or combined crosswise or other modes, this is not limited by the application.
Thus, in embodiments herein, as shown in Figure 6, correction verification module 20 may particularly include: judging unit 21 and identifying unit 22.
Whether judging unit 21 meets the verification rule preset for the title judging wireless network.Judging unit 21 is specifically for performing the step shown in the application embodiment illustrated in fig. 2.From the title of wireless network, the original title of wireless network is i.e. extracted according to the verification rule preset;Verification title is generated by the original title of default verification rule and wireless network;Judge that the title of wireless network is the most consistent with verification title;If the title of wireless network is consistent with verification title, then judge that the title of wireless network meets default verification rule;If the title of wireless network is inconsistent with verification title, then judge the verification rule that the title of wireless network is unsatisfactory for presetting.
Wherein, in an embodiment of the application, judging unit 21 is when the original title of the verification rule by presetting and wireless network generates verification title, first using n character in original title successively as front n the character in verification title, then by the check bit in following cyclic check rule-based algorithm calculating verification title:
Wherein, k ∈ 1 ... N, N are the quantity of check code in check bit, n is the string length of original title, Rn+kFor kth check bit in verification title, Q is the number of default available check code, and wherein, the number of available check code is prime number.
For example, the available check code preset can be 37 shown in table 1, as shown in table 1 including 10 Arabic numerals, 26 English alphabets and " * ", i.e. Q=37, each available check code and numerical value corresponding during calculating thereof.
Identifying unit 22 for meeting default verification rule when the title of wireless network, then judges that wireless network is as mobile data conversion class wireless network.
It is to be understood that, above-mentioned default verification rule once sets, the hotspot name that all terminals all set according to user according to this verification rule when creating wireless network focus (i.e. WIFI hot spot) generates a new wireless network name, the wireless network accessed, when accessing a wireless network, is all identified by all terminals by this verification rule.Wherein, in check bit, quantity N of check code may be set to random natural number, and fault-tolerance when the type of wireless network is carried out the most greatly by the numerical value of N by this verification rule, reliability are the highest.For example, if N is set as 5, i.e. preset verification 5 check bit of rule settings, then the title of a random wireless network meets this probability presetting verification rule is 1/375≈2/100000000.This shows by this verification rule by the mobile data that are mistakenly identified as of the type of wireless network, to change the probability of class be 2/100000000ths.Therefore, the embodiment of the present application can automatically identify the type of the wireless network being currently accessed when terminal accesses wireless network, and fault-tolerance be very strong, reliability is the highest.
Monitoring modular 30 is when wireless network changes class wireless network for mobile data, and the flow being used terminal is monitored.
More specifically, in embodiments herein, monitoring modular 30 can the flow that used in each Preset Time of real-time monitoring terminal.Wherein, Preset Time can be 10 seconds, 1 second, 1 millisecond etc., can be according to monitoring accuracy demand and terminator requirements set, and this is not limited by the application.
Determination module 40 is for when the flow that terminal uses in Preset Time is more than preset flow threshold value, it is determined that the flow of focus is used abnormal by terminal.
The flow of the embodiment of the present application uses abnormal detection device, by obtaining the title of the wireless network that terminal is accessed, and the title of this wireless network is verified, to judge the type of wireless network, and be monitored by moving flow when data change class wireless network, terminal used at wireless network, when being more than preset flow threshold value with the flow used in Preset Time in terminal, judge that the flow of terminal uses abnormal, the type of wireless network can be identified exactly, targetedly mobile data conversion class wireless network is carried out flow analysis and statistics, it is thus possible to accordingly the mobile terminal providing wireless network is carried out traffic protection.The program is high to the identification certainty of the type of wireless network such that it is able to effectively prevent flow waste or the consequence of snowslide excessively using flow to cause because mobile data conversion class wireless network cannot be recognized accurately.
Alternatively, the flow of the embodiment of the present application uses abnormal detection device to may also include the second acquisition module and control module.Fig. 7 is the structural representation that the flow according to another embodiment of the application uses abnormal detection device.As it is shown in fig. 7, this flow uses abnormal detection device, including: the first acquisition module 10, correction verification module 20, monitoring modular 30, determination module the 40, second acquisition module 50 and control module 60.
Specifically, the first acquisition module 10, correction verification module 20, monitoring modular 30 and determination module 40 can not repeat them here as shown in Fig. 5 or Fig. 6 any embodiment.
Second acquisition module 50 is used for obtaining preset flow threshold value.
More specifically, the second acquisition module 50 specifically for: obtain the flow confidence interval of terminal according to the confidence interval monitoring model pre-build;The upper limit according to flow confidence interval determines preset flow threshold value.
Owing to terminal is when accessing the wireless network that focus provides, the consumption to flow is generally focused in the interval range of, and use flow is crossed high situation and seldom occurred.From overall angle, terminal uses flow to substantially conform to a normal distribution when accessing the wireless network that focus provides.The schematic diagram of the curve of this normal distribution can as shown in Figure 4, and wherein, transverse axis x represents the use flow of terminal, and longitudinal axis f (x) represents the probability density using flow of terminal, and α is this scale parameter being distributed the most very much.
Therefore, the population mean of sample variance and normal distribution on the basic model of normal distribution, can be utilized, obtain a confidence interval monitoring model according to confidence level.Then, the flow confidence interval of terminal is obtained according to this confidence interval monitoring model.
If more specifically, the data traffic that terminal uses in i-th Preset Time is Qi, the total flow used in front i Preset Time is Ti, then the average discharge used in front i Preset Time isThen,
When through n Preset Time, in a new Preset Time, there is following discharge relation:
Tn+1=Tn+Qi, and
From the foregoing, it will be observed that the sample variance for the flow in n Preset Time is:
Definition according to sample variance with sample standard deviation can obtain, and the sample standard deviation of the flow in n Preset Time is:
And then the standard deviation of sample average can be can get according to normal distribution mean value computation relation and be
Then according to sample average standard deviation and normal distribution, obtaining confidence interval monitoring model is:
Wherein, α is confidence level,Can be obtained by the standard normal distribution table inquiry that inquiry confidence alpha is corresponding.
Thus, can according to actual monitoring to terminal access wireless network time flow service condition obtain terminal flow use sample average and sample average standard deviation, and bring in the monitoring model of above-mentioned confidence interval, obtain the flow confidence interval of the different confidence levels of terminal.
Wherein, for example, preset flow threshold value can be that the terminal arrived according to the actual monitoring flow service condition when accessing wireless network is calculatedValue.
If the flow that terminal uses is more than preset flow threshold value, then shows that flow service condition now is the small probability time, belong to abnormal conditions, therefore, can determine that and use extremely into flow.
Thus, according to determined by said method flow threshold to judge whether to occur that flow uses abnormal, improve flow and use accuracy and the reliability of abnormality detection.
Control module 60, for when judging that the flow of focus is used abnormal by terminal, carries out Traffic Anomaly prompting or disconnection of wireless network connects.
In an embodiment of the application; if it is determined that the flow of terminal uses abnormal; then control module 60 can carry out Traffic Anomaly prompting or disconnection of wireless network connects; can the user of prompt terminal timely; so that user takes appropriate measures (as disconnected flow or closing big flow application etc.); or disconnection of wireless network connects automatically, thus avoid excessively using or waste of flow, it is achieved that the traffic protection to the mobile terminal providing wireless network.
As a example by realize above-described embodiment, the application also proposes a kind of terminal.
The terminal of the embodiment of the present application includes that the flow shown in the application any embodiment uses abnormal detection device, by obtaining the title of the wireless network that terminal is accessed, and the title of this wireless network is verified, to judge the type of wireless network, and be monitored by moving flow when data change class wireless network, terminal used at wireless network, when being more than preset flow threshold value with the flow used in Preset Time in terminal, judge that the flow of terminal uses abnormal, the type of wireless network can be identified exactly, targetedly mobile data conversion class wireless network is carried out flow analysis and statistics, it is thus possible to accordingly the mobile terminal providing wireless network is carried out traffic protection.The program is high to the identification certainty of the type of wireless network such that it is able to effectively prevent flow waste or the consequence of snowslide excessively using flow to cause because mobile data conversion class wireless network cannot be recognized accurately.
Below with reference to the accompanying drawings wireless network type recognition methods, device and terminal according to the embodiment of the present application described.
Fig. 8 is the wireless network type recognition methods flow chart according to one embodiment of the application.
As shown in Figure 8, this wireless network type recognition methods, comprise the following steps:
S801, obtains the title of the wireless network that terminal is accessed.
Specifically, when terminal accesses wireless network, the title of the current wireless network connected can be obtained by the operating system interface of terminal.
S802, it is judged that whether the title of wireless network meets the verification rule preset.
In an embodiment of the application, user can set up focus by inputting hotspot name and focus credit password in the mobile terminal with focus function, opens focus function, provides wireless network for other-end equipment.The hotspot name (the namely original title of the wireless network that this focus provides) of user setup can be obtained by the operating system interface of mobile terminal, and in hotspot name, add check bit according to default verification rule, obtain new hotspot name, and new hotspot name is supplied to other-end equipment as the title of wireless network.Other-end equipment can access this wireless network according to this wireless network name and corresponding credit password.Thus, the type of wireless network can be judged according to whether the title of wireless network has check bit, if there being check bit, then show during this wireless network, to move data conversion class wireless network, i.e. by the focus function of mobile terminal, GPRS, 2G, 3G or 4G network signal is converted to the wireless network that WIFI signal obtains.
Wherein, preset rules includes when original title according to wireless network generates the rule (such as the quantity of check code in the check bit that generates, the algorithm etc. that generates check code) of check bit and generates the verification title of wireless network, the original title of wireless network and the compound mode of check bit.Such as, the quantity of check code can be set to random natural number, such as 3,4,5 etc., the original title of wireless network and the compound mode of check bit can be combination front and back (original title in front check bit rear), rear before combination (original title in rear check bit front) or combined crosswise or other modes, this is not limited by the application.
Thus, in embodiments herein, whether can meet, by the title judging wireless network, the verification rule preset and identify the type of wireless network.
Specifically, it is judged that whether the title of wireless network meets the verification rule preset includes the step of the application embodiment as shown in Figure 2.
S201, extracts the original title of wireless network from the title of wireless network according to default verification rule.
For example, in the verification rule settings check bit preset, the quantity of check code is 3, and the original title of wireless network is front and back to combine with the compound mode of check bit, then for title ABCC6R of wireless network, the primitive name that can extract wireless network is referred to as ABC.
S202, generates verification title by the original title of default verification rule and wireless network.
Specifically, in an embodiment of the application, first using n character in original title successively as front n the character in verification title, then by the check bit in following cyclic check rule-based algorithm calculating verification title:
Wherein, k ∈ 1 ... N, N are the quantity of check code in check bit, n is the string length of original title, Rn+kFor kth check bit in verification title, Q is the number of default available check code, and wherein, the number of available check code is prime number.
For example, the available check code preset can be 37 shown in table 1, as shown in table 1 including 10 Arabic numerals, 26 English alphabets and " * ", i.e. Q=37, each available check code and numerical value corresponding during calculating thereof.
S203, it is judged that the title of wireless network is the most consistent with verification title.
S204, if the title of wireless network is consistent with verification title, then judges that the title of wireless network meets default verification rule.
S205, if the title of wireless network is inconsistent with verification title, then judges the verification rule that the title of wireless network is unsatisfactory for presetting.
For example, default verification rule to set in check bit the quantity of check code as 3, i.e. N=3, and as a example by the compound mode of the original title of wireless network and check bit is combination front and back: for original title ABC of a wireless network, according to available check bit C6R of the algorithmic formula (1) in above-mentioned verification rule, the then entitled ABCC6R of the wireless network finally given.In like manner, as the entitled ABCC6R of the wireless network that terminal unit accesses, can according to default verification Rule Extraction go out wireless network original title ABC (according to default verification rule remove below 3 obtain), can pass through formula (1) being calculated check bit corresponding to original title ABC is C6R, and be combined as verifying title ABCC6R by check bit and original title, consistent with the title of the wireless network accessed, then judge that the title of wireless network meets default verification rule, and can determine that wireless network is mobile data conversion class wireless network.
It is to be understood that, above-mentioned default verification rule once sets, the hotspot name that all terminals all set according to user according to this verification rule when creating wireless network focus (i.e. WIFI hot spot) generates a new wireless network name, the wireless network accessed, when accessing a wireless network, is all identified by all terminals by this verification rule.Wherein, in check bit, quantity N of check code may be set to random natural number, and fault-tolerance when the type of wireless network is carried out the most greatly by the numerical value of N by this verification rule, reliability are the highest.For example, if N is set as 5, i.e. preset verification 5 check bit of rule settings, then the title of a random wireless network meets this probability presetting verification rule is 1/375≈2/100000000.This shows by this verification rule by the mobile data that are mistakenly identified as of the type of wireless network, to change the probability of class be 2/100000000ths.Therefore, the embodiment of the present application can automatically identify the type of the wireless network being currently accessed when terminal accesses wireless network, and fault-tolerance be very strong, reliability is the highest.
S803, if the title of wireless network meets default verification rule, then judges that wireless network is as mobile data conversion class wireless network.
S804, if the title of wireless network is unsatisfactory for the verification rule preset, then judges that wireless network changes class wireless network as non-moving data.
The wireless network type recognition methods of the embodiment of the present application, by obtaining the title of the wireless network that terminal is accessed, and judge whether the title of wireless network meets the verification rule preset, if meeting this verification preset rule, then can determine that wireless network is mobile data conversion class wireless network, can identify the type of wireless network exactly, fault-tolerance is strong, and reliability is high.
As a example by realize above-described embodiment, the application also proposes a kind of wireless network type identification device.
Fig. 9 is the structural representation of the wireless network type identification device according to one embodiment of the application.
As it is shown in figure 9, this wireless network type identification device, including: acquisition module 210, judge module 220 and determination module 230.
Specifically, acquisition module 210 is for obtaining the title of the wireless network that terminal is accessed.More specifically, when terminal accesses wireless network, acquisition module 210 can obtain the title of the current wireless network connected by the operating system interface of terminal.
Whether judge module 220 meets the verification rule preset for the title judging wireless network.
In an embodiment of the application, user can set up focus by inputting hotspot name and focus credit password in the mobile terminal with focus function, opens focus function, provides wireless network for other-end equipment.The hotspot name (the namely original title of the wireless network that this focus provides) of user setup can be obtained by the operating system interface of mobile terminal, and in hotspot name, add check bit according to default verification rule, obtain new hotspot name, and new hotspot name is supplied to other-end equipment as the title of wireless network.Other-end equipment can access this wireless network according to this wireless network name and corresponding credit password.Thus, the type of wireless network can be judged according to whether the title of wireless network has check bit, if there being check bit, then show during this wireless network, to move data conversion class wireless network, i.e. by the focus function of mobile terminal, GPRS, 2G, 3G or 4G network signal is converted to the wireless network that WIFI signal obtains.
Wherein, preset rules includes when original title according to wireless network generates the rule (such as the quantity of check code in the check bit that generates, the algorithm etc. that generates check code) of check bit and generates the verification title of wireless network, the original title of wireless network and the compound mode of check bit.Such as, the quantity of check code can be set to random natural number, such as 3,4,5 etc., the original title of wireless network and the compound mode of check bit can be combination front and back (original title in front check bit rear), rear before combination (original title in rear check bit front) or combined crosswise or other modes, this is not limited by the application.
Thus, in embodiments herein, it is judged that module 220 specifically includes: extraction unit 221, signal generating unit 222, judging unit 223 and identifying unit 224.
More specifically, extraction unit 221 for extracting the original title of wireless network from the title of wireless network according to the verification rule preset.For example, in the verification rule settings check bit preset, the quantity of check code is 3, and the original title of wireless network is front and back to combine with the compound mode of check bit, then for title ABCC6R of wireless network, the primitive name that can extract wireless network is referred to as ABC.
Signal generating unit 222 is for generating verification title by the original title of default verification rule and wireless network.
In an embodiment of the application, signal generating unit 222 specifically for: using n character in original title successively as verification title in front n character;Check bit by following cyclic check rule-based algorithm calculating verification title:
Wherein, k ∈ 1 ... N, N are the quantity of check code in check bit, n is the string length of original title, Rn+kFor kth check bit in verification title, Q is the number of default available check code, and wherein, the number of available check code is prime number.
Judging unit 223 is the most consistent with verification title for the title judging wireless network;
If identifying unit 224 is consistent with verification title for the title of wireless network, then judge that the title of wireless network meets default verification rule.Identifying unit is additionally operable to when the title of wireless network is inconsistent with verification title, it is determined that the title of wireless network is unsatisfactory for the verification rule preset.
For example, default verification rule to set in check bit the quantity of check code as 3, i.e. N=3, and as a example by the compound mode of the original title of wireless network and check bit is combination front and back: for original title ABC of a wireless network, according to available check bit C6R of the algorithmic formula (1) in above-mentioned verification rule, the then entitled ABCC6R of the wireless network finally given.In like manner, as the entitled ABCC6R of the wireless network that terminal unit accesses, can according to default verification Rule Extraction go out wireless network original title ABC (according to default verification rule remove below 3 obtain), can pass through formula (1) being calculated check bit corresponding to original title ABC is C6R, and be combined as verifying title ABCC6R by check bit and original title, consistent with the title of the wireless network accessed, then judge that the title of wireless network meets default verification rule, and can determine that wireless network is mobile data conversion class wireless network.
It is to be understood that, above-mentioned default verification rule once sets, the hotspot name that all terminals all set according to user according to this verification rule when creating wireless network focus (i.e. WIFI hot spot) generates a new wireless network name, the wireless network accessed, when accessing a wireless network, is all identified by all terminals by this verification rule.Wherein, in check bit, quantity N of check code may be set to random natural number, and fault-tolerance when the type of wireless network is carried out the most greatly by the numerical value of N by this verification rule, reliability are the highest.For example, if N is set as 5, i.e. preset verification 5 check bit of rule settings, then the title of a random wireless network meets this probability presetting verification rule is 1/375≈2/100000000.This shows by this verification rule by the mobile data that are mistakenly identified as of the type of wireless network, to change the probability of class be 2/100000000ths.Therefore, the embodiment of the present application can automatically identify the type of the wireless network being currently accessed when terminal accesses wireless network, and fault-tolerance be very strong, reliability is the highest.
Determination module 230 is for when the title of wireless network meets default verification rule, it is determined that wireless network is mobile data conversion class wireless network.Determination module 230 is additionally operable to when the title of wireless network is unsatisfactory for the verification rule preset, it is determined that wireless network is that non-moving data change class wireless network.
The wireless network type identification device of the embodiment of the present application, by obtaining the title of the wireless network that terminal is accessed, and judge whether the title of wireless network meets the verification rule preset, if meeting this verification preset rule, then can determine that wireless network is mobile data conversion class wireless network, can identify the type of wireless network exactly, fault-tolerance is strong, and reliability is high.
As a example by realize above-described embodiment, the application also proposes another kind of terminal.
The terminal of the embodiment of the present application, wireless network type identification device including the application any embodiment, by obtaining the title of the wireless network that terminal is accessed, and judge whether the title of wireless network meets the verification rule preset, if meeting this verification preset rule, then can determine that wireless network is mobile data conversion class wireless network, it is possible to identify the type of wireless network exactly, fault-tolerance is strong, and reliability is high.
In flow chart or at this, any process described otherwise above or method description are construed as, represent and include one or more module of code, fragment or part for the executable instruction of the step that realizes specific logical function or process, and the scope of the preferred implementation of the application includes other realization, wherein can not be by order that is shown or that discuss, including according to involved function by basic mode simultaneously or in the opposite order, performing function, this should be understood by embodiments herein person of ordinary skill in the field.
Represent in flow charts or the logic described otherwise above at this and/or step, such as, it is considered the sequencing list of executable instruction for realizing logic function, may be embodied in any computer-readable medium, use for instruction execution system, device or equipment (system such as computer based system, including processor or other can be from instruction execution system, device or equipment instruction fetch the system performing instruction), or combine these instruction execution systems, device or equipment and use.For the purpose of this specification, " computer-readable medium " can be any can to comprise, store, communicate, propagate or transmission procedure for instruction execution system, device or equipment or combines these instruction execution systems, device or equipment and the device that uses.The more specifically example (non-exhaustive list) of computer-readable medium includes following: have the electrical connection section (electronic installation) of one or more wiring, portable computer diskette box (magnetic device), random access memory (RAM), read only memory (ROM), erasable edit read only memory (EPROM or flash memory), fiber device, and portable optic disk read only memory (CDROM).Additionally, computer-readable medium can even is that paper or other the suitable media that can print described program thereon, because can be such as by paper or other media be carried out optical scanning, then carry out editing, interpreting or be processed to electronically obtain described program with other suitable methods if desired, be then stored in computer storage.
Should be appreciated that each several part of the application can realize by hardware, software, firmware or combinations thereof.In the above-described embodiment, multiple steps or method can realize with software or the firmware that storage in memory and is performed by suitable instruction execution system.Such as, if realized with hardware, as in another embodiment, can realize by any one in following technology well known in the art or their combination: there is the discrete logic of logic gates for data signal realizes logic function, there is the special IC of suitable combination logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc..
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries can be by program and complete to instruct relevant hardware, described program can be stored in a kind of computer-readable recording medium, this program upon execution, including one or a combination set of the step of embodiment of the method.
Additionally, each functional unit in each embodiment of the application can be integrated in a processing module, it is also possible to be that unit is individually physically present, it is also possible to two or more unit are integrated in a module.Above-mentioned integrated module both can realize to use the form of hardware, it would however also be possible to employ the form of software function module realizes.If described integrated module is using the form realization of software function module and as independent production marketing or use, it is also possible to be stored in a computer read/write memory medium.
Storage medium mentioned above can be read only memory, disk or CD etc..
In the description of this specification, the description of reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. means that the specific features, structure, material or the feature that combine this embodiment or example description are contained at least one embodiment or the example of the application.In this manual, the schematic representation to above-mentioned term is not necessarily referring to identical embodiment or example.And, the specific features of description, structure, material or feature can combine in any one or more embodiments or example in an appropriate manner.
While there has been shown and described that embodiments herein, it will be understood by those skilled in the art that: these embodiments can carry out in the case of without departing from the principle of the application and objective multiple change, revise, replace and modification, scope of the present application is limited by claim and equivalent thereof.