CN104780528B - Network flow update method and device - Google Patents

Network flow update method and device Download PDF

Info

Publication number
CN104780528B
CN104780528B CN201410010629.4A CN201410010629A CN104780528B CN 104780528 B CN104780528 B CN 104780528B CN 201410010629 A CN201410010629 A CN 201410010629A CN 104780528 B CN104780528 B CN 104780528B
Authority
CN
China
Prior art keywords
sim card
value
field
currently
sim
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410010629.4A
Other languages
Chinese (zh)
Other versions
CN104780528A (en
Inventor
周兰兰
张雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410010629.4A priority Critical patent/CN104780528B/en
Publication of CN104780528A publication Critical patent/CN104780528A/en
Application granted granted Critical
Publication of CN104780528B publication Critical patent/CN104780528B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of network flow update method and devices.Wherein, this method includes:The value of the field for identifying the SIM card currently networked is obtained from the configuration file of terminal, wherein the first SIM card and the second SIM card are at least configured in terminal, the first SIM card and the second SIM card correspond to identical network card identification;Judge that the SIM card currently networked of value mark of field be the first SIM card is still the second SIM card;If the SIM card that the value mark of field is currently networked is the first SIM card, it is updated using the web-based history flow of the first SIM card of variable quantity pair of the current network flow got;If the SIM card that the value mark of field is currently networked is the second SIM card, it is updated using the web-based history flow of the second SIM card of variable quantity pair of the current network flow got.The present invention solves the technical issues of identical double card double standby mobile phone of network card identification can not count each card network flow respectively, has achieved the effect that accurately distinguish statistics each card network flow of double card double standby mobile phone.

Description

Network flow update method and device
Technical field
The present invention relates to cell phone managing fields, in particular to a kind of network flow update method and device.
Background technology
In recent years, double card double standby mobile phone market development in China's is rapid, and product output is persistently expanded, this makes double-card dual-standby hand Occupancy volume is increasing in the market for machine.In such case, requirement of the mobile phone user for double card double standby mobile phone be also increasingly Increase, is especially concerned with how effectively to manage double card.After the powerful dorsal support of mobile Internet, to the flow of double-card mobile phone Statistics is even more the emphasis of mobile phone user's concern.
Now some cell phone managing softwares such as mobile phone house keeper for the support main attention of flow be in single-card mobile phone, and It is but less perfect for the support of double-card mobile phone.It is limited to setting of the cell phone manufacturer for double-card mobile phone traffic management, this just leads Some cell phone softwares such as mobile phone house keeper are caused for the traffic statistics inaccuracy of double-card mobile phone or can not simply be supported.Currently, mobile phone The technical solution that house keeper uses relies primarily on cell phone manufacturer to the traffic statistics of double-card mobile phone and matches to the network interface card field of double-card mobile phone It sets, this is very passive.Which card what mobile phone house keeper judged finally to network by the data variation in dev files is, and The SIM finally to network(Subscriber Identity Module, client identification module)Card is as currently networking SIM card cannot be differentiated however, if the field of two cards is the same.The program excessively relies on cell phone manufacturer to double-card mobile phone stream The mode of amount record also just says that two cards are a field if cell phone manufacturer does not differentiate between field record to double-card mobile phone Network interface card records, then this scheme is at very awkward condition, it will carry out traffic statistics to the network interface card field there are one only Mobile phone is at a complete loss as to what to do.
In this application, SIM card is also referred to as smart card or subscriber identification card, can be used for different mobile communication The network of standard system, for example, cdma network, WCDMA networks, GSM network, TD-SCDMA network.
For above-mentioned problem, currently no effective solution has been proposed.
Invention content
An embodiment of the present invention provides a kind of network flow update method and devices, identical at least to solve network card identification Double card double standby mobile phone can not count the technical issues of each card network flow respectively.
One side according to the ... of the embodiment of the present invention provides a kind of network flow update method, including:From matching for terminal Set the value that the field for identifying the SIM card currently networked is obtained in file, wherein the first SIM is at least configured in terminal Card and the second SIM card, the first SIM card and the second SIM card correspond to identical network card identification;Judge the current connection of value mark of field The SIM card of net is that the first SIM card is still the second SIM card;If the SIM card that the value mark of field is currently networked is the first SIM Card, then be updated using the web-based history flow of the first SIM card of variable quantity pair of the current network flow got;If field The SIM card currently networked of value mark be the second SIM card, then using the variable quantity pair second of the current network flow got The web-based history flow of SIM card is updated.
Optionally, the value of field of the acquisition for identifying the SIM card currently networked includes from the configuration file of terminal: Be used for corresponding with the operating system run in the type of terminal and/or terminal is searched from the adaptation file of installation in the terminal Identify the field for the SIM card currently networked;The value of field is obtained from the configuration file of terminal.
Optionally, judge that the SIM card currently networked of value mark of field be the first SIM card is still the second SIM card packet It includes:It is still the second SIM card that the SIM card that the value judgement for the first field for including according to field is currently networked, which is the first SIM card,; Or the value of the second field and third field included at least according to field judges the SIM card currently networked as the first SIM card Or it is the second SIM card.
Optionally, field includes the first field, judges that the value of field identifies the SIM card currently networked as the first SIM card Or include for the second SIM card:Judge whether the value of the first field is the first value, if the value of the first field is the first value, Then indicate that the first SIM card is currently at working condition, the second SIM card is currently at standby mode, and judge currently to network SIM card is the first SIM card;Judge whether the value of the first field is second value, if the value of the first field is second value, table Show that the first SIM card is currently at standby mode, the second SIM card is currently at working condition, and judges the SIM card currently networked For the second SIM card;Judge whether the value of the first field is third value, if the value of the first field is third value, then it represents that the One SIM card is activated, the second SIM card is deactivated, and judges that the SIM card currently networked is the first SIM card;Judge the first field Value whether be the 4th value, if the value of the first field is the 4th value, then it represents that the first SIM card is deactivated, the second SIM card quilt It enables, and judges that the SIM card currently networked is the second SIM card.
Optionally, field includes the second field and third field, judges that the SIM card that the value mark of field is currently networked is First SIM card is still that the second SIM card includes:Judge whether the value of the second field is the 5th value, if the value of the second field For the 5th value, then it represents that the first SIM card is currently at working condition, the second SIM card is currently at standby mode, alternatively, first SIM card is currently at standby mode, the second SIM card is currently at working condition;In the feelings that the value of the second field is the 5th value Under condition, judges that the value of third field be the 6th value is still the 7th value, if the value of third field is the 6th value, judge The SIM card currently networked is that the first SIM card judges that the SIM card currently networked is if the value of third field is the 7th value Second SIM card;Judge whether the value of the second field is the 8th value, if the value of the second field is the 8th value, then it represents that first SIM card is activated, the second SIM card is deactivated, and judges that the SIM card currently networked is the first SIM card;Judge the second field Whether value is the 9th value, if the value of the second field is the 9th value, then it represents that the first SIM card is deactivated, the second SIM card is opened With, and judge that the SIM card currently networked is the second SIM card.
Optionally, it is carried out using the web-based history flow of the first SIM card of variable quantity pair of the current network flow got Update includes:The web-based history flow of first SIM card is updated to the web-based history flow and current network flow of the first SIM card The sum of variable quantity;It is carried out more using the web-based history flow of the second SIM card of variable quantity pair of the current network flow got Include newly:The web-based history flow of second SIM card is updated to the web-based history flow and current network flow of the second SIM card The sum of variable quantity.
Another aspect according to the ... of the embodiment of the present invention additionally provides a kind of network flow updating device, including:It obtains single Member, the value for obtaining the field for identifying the SIM card currently networked from the configuration file of terminal, wherein in terminal It is at least configured with the first SIM card and the second SIM card, the first SIM card and the second SIM card correspond to identical network card identification;Judge single Member, it is still the second SIM card that identify the SIM card currently networked, which be the first SIM card, for judging the value of field;First update is single Member uses the current network flow got when the SIM card for currently networking in the value mark of field is the first SIM card The web-based history flow of the first SIM card of variable quantity pair be updated;Second updating unit is worked as the value mark in field When the SIM card of preceding networking is the second SIM card, the history of the second SIM card of variable quantity pair of the current network flow got is used Network flow is updated.
Optionally, acquiring unit includes:Searching module, for being searched from installation adaptation file in the terminal and terminal Type and/or terminal on the corresponding field for identifying the SIM card currently networked of the operating system that runs;Acquisition module, Value for obtaining field from the configuration file of terminal.
Optionally, judging unit includes:The value of first judgment module, the first field for including according to field judges The SIM card currently networked is that the first SIM card is still the second SIM card;Or second judgment module, at least being wrapped according to field It is still the second SIM card that the SIM card that the value judgement of the second field and third field that include currently is networked, which is the first SIM card,.
Optionally, field includes the first field, and judging unit further includes:Third judgment module, for judging the first field Value whether be the first value, if the value of the first field be the first value, then it represents that the first SIM card be currently at working condition, Second SIM card is currently at standby mode, and judges that the SIM card currently networked is the first SIM card;4th judgment module is used In judging whether the value of the first field is second value, if the value of the first field is second value, then it represents that the first SIM card is current Be in standby, the second SIM card is currently at working condition, and judge the SIM card currently networked be the second SIM card;The Five judgment modules, for judging whether the value of the first field is third value, if the value of the first field is third value, then it represents that First SIM card is activated, the second SIM card is deactivated, and judges that the SIM card currently networked is the first SIM card;6th judges mould Block, for judging whether the value of the first field is the 4th value, if the value of the first field is the 4th value, then it represents that the first SIM Card is deactivated, the second SIM card is activated, and judges that the SIM card currently networked is the second SIM card.
Optionally, field includes the second field and third field, judging unit include:7th judgment module, for judging Whether the value of the second field is the 5th value, if the value of the second field is the 5th value, then it represents that the first SIM card is currently at work Make state, the second SIM card is currently at standby mode, alternatively, to be currently at standby mode, the second SIM card current for the first SIM card It is in running order;The value of the second field be five values in the case of, judge the value of third field for the 6th value still Judge that the SIM card currently networked is the first SIM card, if third word if the value of third field is the 6th value for the 7th value The value of section is the 7th value, then judges that the SIM card currently networked is the second SIM card;8th judgment module, for judging second Whether the value of field is the 8th value, if the value of the second field is the 8th value, then it represents that the first SIM card is activated, the 2nd SIM Card is deactivated, and judges that the SIM card currently networked is the first SIM card;9th judgment module, for judging taking for the second field Whether value is the 9th value, if the value of the second field is the 9th value, then it represents that the first SIM card is deactivated, the second SIM card is opened With, and judge that the SIM card currently networked is the second SIM card.
Optionally, which further includes:First updating unit includes:First update module, for going through the first SIM card History network flow is updated to the web-based history flow of the first SIM card and the sum of the variable quantity of current network flow;Second update is single Member includes:Second update module, the web-based history stream for the web-based history flow of the second SIM card to be updated to the second SIM card The sum of the variable quantity of amount and current network flow.
In embodiments of the present invention, it is obtained using from the configuration file of terminal for identifying the SIM card currently networked Which card is the mode of the value of field judge the SIM card currently networked as, and then will acquire net by the value of the field The variable quantity of network flow is updated the historical traffic of corresponding SIM card, has reached and has distinguished statistic fluid to double card double standby mobile phone The purpose of amount, to realize the technique effect for accurately distinguishing statistics each card network flow variable quantity of double card double standby mobile phone, in turn Solves the technical issues of identical double card double standby mobile phone of network card identification can not count each card network flow respectively.
Description of the drawings
Attached drawing described herein is used to provide further understanding of the present invention, and is constituted part of this application, this hair Bright illustrative embodiments and their description are not constituted improper limitations of the present invention for explaining the present invention.In the accompanying drawings:
Fig. 1 is a kind of flow chart of optional network flow update method according to the ... of the embodiment of the present invention;
Fig. 2 is a kind of schematic diagram of the configuration file of optional terminal according to the ... of the embodiment of the present invention;
Fig. 3 is the flow chart of another optional network flow update method according to the ... of the embodiment of the present invention;
Fig. 4 is the flow chart of another optional network flow update method according to the ... of the embodiment of the present invention;
Fig. 5 is the flow chart of another optional network flow update method according to the ... of the embodiment of the present invention;
Fig. 6 is the flow chart of another optional network flow update method according to the ... of the embodiment of the present invention;
Fig. 7 is a kind of schematic diagram of optional network flow updating device according to the ... of the embodiment of the present invention;
Fig. 8 is the schematic diagram of another optional network flow updating device according to the ... of the embodiment of the present invention;
Fig. 9 is the schematic diagram of another optional network flow updating device according to the ... of the embodiment of the present invention;And
Figure 10 is the schematic diagram of another optional network flow updating device according to the ... of the embodiment of the present invention.
Specific implementation mode
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people The every other embodiment that member is obtained without making creative work should all belong to the model that the present invention protects It encloses.
It should be noted that term " first " in description and claims of this specification and above-mentioned attached drawing, " Two " etc. be for distinguishing similar object, without being used to describe specific sequence or precedence.It should be appreciated that using in this way Data can be interchanged in the appropriate case, so as to the embodiment of the present invention described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " comprising " and " having " and their any deformation, it is intended that cover It includes to be not necessarily limited to for example, containing the process of series of steps or unit, method, system, product or equipment to cover non-exclusive Those of clearly list step or unit, but may include not listing clearly or for these processes, method, product Or the other steps or unit that equipment is intrinsic.
Embodiment 1
According to embodiments of the present invention, a kind of network flow update method is provided, as shown in Figure 1, this method includes:
S102 obtains the value of the field for identifying the SIM card currently networked from the configuration file of terminal, wherein The first SIM card and the second SIM card are at least configured in terminal, the first SIM card and the second SIM card correspond to identical network card identification;
Optionally, above-mentioned network flow update method is applied to various terminals in the present embodiment, for example, mobile phone, tablet Computer.Certainly, the citing of above-mentioned terminal is a kind of example, and the application does not limit this.
Optionally, the terminal in the present embodiment may include at least two SIM cards, for example, two SIM cards or three SIM card, the application do not limit this.
Optionally, the operating status of double card double standby mobile phone includes but not limited to following at least one in the present embodiment: SIM1 enablings SIM2 is deactivated, SIM1 deactivates SIM2 enablings, SIM1 work SIM2 is standby, the standby SIM2 of SIM1 work.Optionally, on Which SIM card state that different operating statuses can indicate currently to network is, for example, operating status " SIM1 enables SIM2 and deactivates " What is indicated is that currently to network is SIM1.
Above-mentioned steps S102 is described by taking mobile phone as an example, and the first SIM card and the second SIM card, two cards pair are configured on mobile phone The card slot network card identification having the same answered obtains the word for identifying the SIM card currently networked from the configuration file of mobile phone The value of section.Optionally, the field in the present embodiment for identifying the SIM card currently networked includes but not limited to:One word Section, two fields or more than two fields.
For example, in conjunction with shown in (a)-(b) in Fig. 2, described by taking mobile phone A as an example, the first SIM card is configured in mobile phone A SIM1 and the second SIM card SIM2(As shown in phantom in FIG.), the corresponding identical network card identification of two cards(For example, mark is sim_ logo), the file in mobile phone includes but not limited to:Configuration file(For example, file), audio file(For example, media), picture File(For example, picture), wherein configuration file(For example, file)Include field dual_sim_mode_setting, Value can be but be not limited to:1,2, wherein field dual_sim_mode_setting values are the SIM that 1 expression is currently networked Card is the first SIM card SIM1, and field dual_sim_mode_setting values are that the SIM card that 2 expressions are currently networked is second SIM card SIM2.
S104 judges that the SIM card currently networked of value mark of field be the first SIM card is still the second SIM card;
For example, obtaining the field for identifying the SIM card currently networked(For example, dual_sim_mode_setting)'s After value, judge its value for 1 or 2, wherein field dual_sim_mode_setting values are that 1 expression is currently networked SIM card is the first SIM card SIM1, and field dual_sim_mode_setting values are that the SIM card that 2 expressions are currently networked is the Two SIM card SIM2.
S106 uses the current net got if the SIM card that the value mark of field is currently networked is the first SIM card The web-based history flow of the first SIM card of variable quantity pair of network flow is updated;
Optionally, web-based history flow in the present embodiment includes but not limited to:Total web-based history flow, the first SIM The web-based history flow of card, the web-based history flow of the second SIM card.For example, total web-based history flow of mobile phone A is 20M, first The web-based history flow of SIM card is 15M, and the web-based history flow of the second SIM card is 5M.
For example, judgement obtains the field of SIM card(For example, dual_sim_mode_setting)Value be 1, i.e., currently The SIM card of networking is the first SIM card SIM1, then utilizes the history net of the first SIM card of variable quantity pair SIM1 of current network flow Network flow is updated.For example, detecting that current used network flow is 25M, then according to current used network flow Amount may determine that the variable quantity of current network flow is 5M with total web-based history flow, and the SIM card currently networked is learnt in judgement For the first SIM card SIM1, then it is updated using the web-based history flow of the first SIM card of the 5M variable quantities pair SIM1 got. Therefore, the web-based history flow of the first SIM card SIM1 of updated mobile phone A is 20M, the web-based history of the second SIM card SIM2 Flow is 5M, and total web-based history flow of mobile phone A is updated to current used network flow, that is, 25M.
S108 uses the current net got if the SIM card that the value mark of field is currently networked is the second SIM card The web-based history flow of the second SIM card of variable quantity pair of network flow is updated.
For example, judgement obtains the field of SIM card(For example, dual_sim_mode_setting)Value be 2, i.e., currently The SIM card of networking is the second SIM card SIM2, then utilizes the history net of the second SIM card of variable quantity pair SIM2 of current network flow Network flow is updated.For example, detecting that current used network flow is 25M, then according to current used network flow Amount may determine that the variable quantity of current network flow is 5M with total web-based history flow, and the SIM card currently networked is learnt in judgement For the second SIM card SIM2, then it is updated using the web-based history flow of the second SIM card of the 5M variable quantities pair SIM2 got. Therefore, the web-based history flow of the first SIM card SIM1 of updated mobile phone A is 15M, the web-based history of the second SIM card SIM2 Flow is 10M, and total web-based history flow of mobile phone A is updated to current used network flow, that is, 25M.
By embodiment provided by the present application, using in the configuration file of terminal for identifying the SIM card currently networked The value of field is judged to distinguish the SIM card currently networked, and then is gone through to corresponding SIM card using the variable quantity of network flow History network flow is updated, and double card double standby mobile phone is allow to more accurately distinguish between the variable quantity for the network flow for counting each card.
As a kind of optional scheme, as shown in figure 3, step S102, obtains from the configuration file of terminal for identifying The value of the field for the SIM card currently networked includes:
S302 searches the operation run in type and/or terminal with terminal from the adaptation file of installation in the terminal The corresponding field for identifying the SIM card currently networked of system;
Optionally, the type of terminal in the present embodiment can be, but not limited to be divided according to production firm, wherein mobile phone Manufacturer includes but not limited to:Samsung, apple, Nokia.Optionally, the system run in terminal in the present embodiment includes but not It is limited to:Apple IOS systems, Android android system, Windows Phone systems, Saipan Symbian system.
For example, in conjunction with shown in table 1, the adaptation file installed in the terminal may include the following contents:
Table 1
The type of terminal The system run in terminal Field for identifying the SIM card currently networked
Samsung Android android system dual_sim_mode_setting
Apple Apple IOS systems dual_sim_mode_setting_ios
Nokia Saipan Symbian system dual_sim_mode_setting_symbian
As shown in table 1, it can find in the adaptation file in terminal and to be run in type and/or terminal with terminal The corresponding field for identifying the SIM card currently networked of operating system.
For example, mobile phone A is Samsung mobile phone, the system of operation is Android android system, wherein the configuration text of the system Field in part for identifying the SIM card currently networked is dual_sim_mode_setting.Under the scene, used obtaining When the field for the SIM card that mark is currently networked, it can be found in the adaptation file mounted on mobile phone and above-mentioned terminal Type and the corresponding field for identifying the SIM card currently networked of aforesaid operations system, for example, can by searching for above-mentioned table 1 To find for identifying the field for the SIM card currently networked as dual_sim_mode_setting.
S304 obtains the value of field from the configuration file of terminal.
For example, being described so that mobile phone A is Samsung mobile phone as an example, the system of operation is Android android system, according in mobile phone Adaptation file in find the mobile phone for identify the SIM card currently networked field be dual_sim_mode_setting, The value of field dual_sim_mode_setting is then obtained to the configuration file of mobile phone.
By embodiment provided by the present application, searched in type and/or terminal with terminal from the adaptation file of terminal The corresponding field for identifying the SIM card currently networked of operating system of operation, then obtain the word to the configuration file of terminal The value of section, can directly acquire different terminals type in this way, and the SIM card in different operating systems is used to identify the word of networking Section, realizes and obtains different fields in real time according to demand, and then the more accurately effect of the variable quantity of network flow calculation.
As a kind of optional scheme, in conjunction with shown in Fig. 4, step S104 judges what the value mark of field was currently networked It is still the second SIM card includes following at least one mode that SIM card, which is the first SIM card,:
The value of S402, the first field for including according to field judge that the SIM card currently networked is that the first SIM card is still Second SIM card;
Optionally, in the present embodiment be used for identify the SIM card currently networked field be a field, when the application not It is only limitted to this, the field for identifying the SIM card currently networked can also include two fields or more than two fields.
For example, by taking mobile phone A is Samsung mobile phone as an example, the system of operation is Android android system, and the mobile phone is for identifying First field of the SIM card currently networked is dual_sim_mode_setting, judges current networking according to the value of the field SIM card be the first SIM card SIM1 be still the second SIM card SIM2.
In conjunction with shown in table 2, it may determine that according to the value of the first field dual_sim_mode_setting and currently to network SIM card is that the first SIM card is still the second SIM card, it may also be used for judges the operating status of current phone:
Table 2
As seen from the above table, if judging to show that the first field dual_sim_mode_setting values are 1, judgement is sold The current operating status of machine is that SIM1 work SIM2 is standby, and the SIM card that this expression is currently networked is the first SIM card SIM1;If sentencing It is disconnected to show that the first field dual_sim_mode_setting values are 2, then judge that the current operating status of mobile phone waits for for SIM1 Machine SIM2 work, the SIM card that this expression is currently networked are the second SIM card SIM2;If judgement obtains the first field dual_sim_ Mode_setting values are 3, then judge that the current operating status of mobile phone is that SIM1 enablings SIM2 is deactivated, this indicates current connection The SIM card of net is the first SIM card SIM1;If judging to show that the first field dual_sim_mode_setting values are 4, sentence Break and the current operating status of mobile phone for the deactivated SIM2 enablings of SIM1, the SIM card that this expression is currently networked is the second SIM card SIM2。
The value of S404, the second field included at least according to field and third field judges that the SIM card currently networked is First SIM card is still the second SIM card.
For example, mobile phone A is described for Samsung mobile phone, the system of operation is Android android system, and the mobile phone is for marking The second field for knowing the SIM card currently networked is dual_sim_mode_setting, and third field is gprs_connection_ Setting may determine that the SIM card currently networked be the first SIM card SIM1 is still second according to the value of above-mentioned two field SIM card SIM2.
In conjunction with shown in table 3, according to the second field dual_sim_mode_setting and third field gprs_ of mobile phone The value of connection_setting, it can be determined that the SIM card currently networked is that the first SIM card is still the second SIM card, also It can be used for judging the operating status of current phone:
Table 3
As seen from the above table, if judge to show that the second field dual_sim_mode_setting values are 3, mobile phone Operating status can be " SIM1 work SIM2 is standby " or " the standby SIM2 work of SIM1 ", in such a case, it is possible to lead to again It crosses third field gprs_connection_setting and further judges which SIM card currently network is, if third field The value of gprs_connection_setting is 1, then judges that the current operating status of mobile phone is that SIM1 work SIM2 is waited for Machine, the SIM card that this expression is currently networked are the first SIM card SIM1;If judgement obtains third field gprs_connection_ Setting values are 2, then judge that the current operating status of mobile phone is the standby SIM2 work of SIM1, what this expression was currently networked SIM card is the second SIM card SIM2.
If judging to show that the second field dual_sim_mode_setting values are 1, the current operation of mobile phone is judged State is that SIM1 enablings SIM2 is deactivated, and the SIM card that this expression is currently networked is the first SIM card SIM1;If judgement obtains the second word Section dual_sim_mode_setting values are 2, then judge that the current operating status of mobile phone is that SIM1 deactivates SIM2 enablings, The SIM card that this expression is currently networked is the second SIM card SIM2.
By embodiment provided by the present application, using the judgement to field value, not only may be implemented to accurately distinguish statistics The statistics of the variable quantity of the network flow of first SIM card and the second SIM card can also realize the operation of identification double card double standby mobile phone State.
As a kind of optional scheme, in conjunction with shown in Fig. 5, field includes the first field, and step S104 judges taking for field It is still the second SIM card that the SIM card that value mark is currently networked, which is the first SIM card, can also include:
S502 judges whether the value of the first field is the first value, if the value of the first field is the first value, then it represents that the One SIM card is currently at working condition, the second SIM card is currently at standby mode, and judges that the SIM card currently networked is the One SIM card;
For example, in conjunction with shown in table 2, if judging to obtain the first field dual_sim_mode_setting values as the first value (For example, the first value is 1), then it represents that the current operating status of mobile phone is SIM1 work SIM2 SIM cards that are standby, and currently networking For the first SIM card SIM1.
S504 judges whether the value of the first field is second value, if the value of the first field is second value, then it represents that the One SIM card is currently at standby mode, the second SIM card is currently at working condition, and judges that the SIM card currently networked is the Two SIM cards;
For example, in conjunction with shown in table 2, if judging to obtain the first field dual_sim_mode_setting values as second value (For example, second value is 2), then it represents that the current operating status of mobile phone works for the standby SIM2 of SIM1, and the SIM card currently networked For the second SIM card SIM2.
S506 judges whether the value of the first field is third value, if the value of the first field is third value, then it represents that the One SIM card is activated, the second SIM card is deactivated, and judges that the SIM card currently networked is the first SIM card;
For example, in conjunction with shown in table 2, if judging to obtain the first field dual_sim_mode_setting values as third value (For example, third value is 3), then it represents that the current operating status of mobile phone enables SIM2 for SIM1 and deactivates, and the SIM card currently networked For the first SIM card SIM1.
S508 judges whether the value of the first field is the 4th value, if the value of the first field is the 4th value, then it represents that the One SIM card is deactivated, the second SIM card is activated, and judges that the SIM card currently networked is the second SIM card.
For example, in conjunction with shown in table 2, if judging to obtain the first field dual_sim_mode_setting values as the 4th value (For example, the 4th value is 4), then it represents that the current operating status of mobile phone is that SIM1 deactivates SIM2 enablings, and the SIM card currently networked For the second SIM card SIM2.
By embodiment provided by the present application, using the judgement to field value, not only may be implemented to accurately distinguish statistics The statistics of the variable quantity of the network flow of first SIM card and the second SIM card can also realize the operation of identification double card double standby mobile phone State.
As a kind of optional scheme, field includes the second field and third field, and step S104 judges the value of field It is still the second SIM card that the SIM card that mark is currently networked, which is the first SIM card, can also include:
S1 judges whether the value of the second field is the 5th value, if the value of the second field is the 5th value, then it represents that first SIM card is currently at working condition, the second SIM card is currently at standby mode, alternatively, the first SIM card is currently at standby shape State, the second SIM card are currently at working condition;In the case where the value of the second field is five value, third field is judged Value is that the 6th value is still the 7th value, if the value of third field is the 6th value, judges that the SIM card currently networked is the One SIM card judges that the SIM card currently networked is the second SIM card if the value of third field is the 7th value;
For example, in conjunction with shown in table 3, if judging to obtain the second field dual_sim_mode_setting values as the 5th value (For example, the 5th value is 3)When, then it represents that the first SIM card SIM1 is currently at working condition, the second SIM card SIM2 is currently at Standby mode, alternatively, the first SIM card SIM1 is currently at standby mode, the second SIM card is currently at working condition SIM2, base In the second field value be the 5th value(For example, the 5th value is 3)In the case of, then pass through third field gprs_connection_ Which SIM card what setting further judged currently to network is, if third field gprs_connection_setting's takes Value is the 6th value(For example, the 6th value is 1), then judge that the SIM card currently networked is the first SIM card;Third field gprs_ Connection_setting values are the 7th value(For example, the 7th value is 2), then judge that the SIM card currently networked is second SIM card.
S2 judges whether the value of the second field is the 8th value, if the value of the second field is the 8th value, then it represents that first SIM card is activated, the second SIM card is deactivated, and judges that the SIM card currently networked is the first SIM card;
For example, in conjunction with shown in table 3, judged by the value of the second field dual_sim_mode_setting, if the second word The value of section dual_sim_mode_setting is the 8th value(For example, the 8th value is 1), then it represents that the current operation shape of mobile phone State is that SIM1 enablings SIM2 is deactivated, and the SIM card currently networked is the first SIM card SIM1;
S3 judges whether the value of the second field is the 9th value, if the value of the second field is the 9th value, then it represents that first SIM card is deactivated, the second SIM card is activated, and judges that the SIM card currently networked is the second SIM card.
For example, in conjunction with shown in table 3, judged by the value of the second field dual_sim_mode_setting, if the second word The value of section dual_sim_mode_setting is the 9th value(For example, the 9th value is 2), then it represents that the current operation shape of mobile phone State is that SIM1 deactivates SIM2 enablings, and the SIM card currently networked is the second SIM card SIM2.
By embodiment provided by the present application, using the judgement to field value, not only may be implemented to accurately distinguish statistics The statistics of the variable quantity of the network flow of first SIM card and the second SIM card can also realize the operation of identification double card double standby mobile phone State.
As a kind of optional scheme, step S106 uses the first SIM of variable quantity pair of the current network flow got The web-based history flow of card be updated including:The web-based history flow of first SIM card is updated to the first SIM card by S602 The sum of the variable quantity of web-based history flow and current network flow;
Optionally, newest made can be obtained with the changes in flow rate of real-time monitoring terminal operating system in the present embodiment Network flow variable quantity.
For example, by taking mobile phone A as an example, it is assumed that total web-based history flow of the mobile phone is historyData, wherein is also set up One interim replacement variable tempData, current used network flow is newData, the history net of the first SIM card SIM1 Network flow is card1Data, and the web-based history flow of the second SIM card SIM2 is card2Data.
When monitoring that the network flow of mobile phone changes, then the variable quantity of network flow is calculated by the following formula:
tempData=newData–historyData (1)
Wherein, historyData is total web-based history flow of mobile phone;NewData is current used network flow; TempData is interim replacement variable.
If it is that the network flow of the first SIM card SIM1 changes to be learnt by judgement, will be according to following formula meter The first updated network flows of SIM card SIM1 are calculated, and the web-based history flow of the first SIM card SIM1 is updated to the first SIM Block the sum of the variable quantity of the web-based history flow and current network flow of SIM1:
card1Data’=card1Data+tempData (2)
Wherein, card1Data ' is the updated web-based history flows of the first SIM card SIM1, and card1Data is the first SIM Block the web-based history flow before SIM1 updates, tempData is interim replacement variable, and value is equal to the variable quantity of network flow.
For example, the web-based history flow historyData of mobile phone is 20M, the web-based history before the first SIM card SIM1 updates Flow card1Data is 15M, then the web-based history flow card2Data before the second SIM card SIM2 updates is 5M, has currently been made Network flow newData is 25M, and the interim variable tempData that replaces is 25-20=5M, and the SIM currently to network is learnt in judgement Card is the first SIM card SIM1, then the updated web-based history flows of the first SIM card SIM1 are:15+5=20M, and by the total of mobile phone Web-based history flow historyData is updated to current used network flow newData, as 25M.
Step S108, using the current network flow got the second SIM card of variable quantity pair web-based history flow into Row updates:S604, by the web-based history flow of the second SIM card be updated to the web-based history flow of the second SIM card with it is current The sum of variable quantity of network flow.
If it is that the network flow of the second SIM card SIM2 changes to be learnt by judgement, will be according to following formula meter The updated web-based history flows of the second SIM card SIM2 are calculated, and the web-based history flow of the second SIM card SIM2 is updated to second The web-based history flow of SIM card SIM2 and the sum of the variable quantity of current network flow:
Card2Data’=card2Data+tempData (3)
Wherein, card2Data ' is the updated web-based history flows of the second SIM card SIM2, and card2Data is the 2nd SIM Block the web-based history flow before SIM2 updates, tempData is interim replacement variable, and value is equal to the variable quantity of network flow.
For example, total web-based history flow historyData of mobile phone is 20M, the history net before the first SIM card SIM1 updates Network flow card1Data is 15M, then the web-based history flow card2Data before the second SIM card SIM2 updates is 5M, currently The network flow newData used is 25M, and the interim variable tempData that replaces is 25-20=5M, judges to learn and currently network SIM card is the second SIM card SIM2, then the updated web-based history flows of the second SIM card SIM2 are:5+5=10M, and by mobile phone Total web-based history flow historyData is updated to current used network flow newData, as 25M.
By embodiment provided by the present application, phase after being added into judgement using the variable quantity of the current network flow of acquisition In the SIM card currently networked answered, realizes in real time according to the corresponding field of different terminals, accurately distinguish statistics double-card dual-standby hand The network flow variable quantity that machine respectively blocks.
It should be noted that for each method embodiment above-mentioned, for simple description, therefore it is all expressed as a series of Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the described action sequence because According to the present invention, certain steps can be performed in other orders or simultaneously.Secondly, those skilled in the art should also know It knows, embodiment described in this description belongs to preferred embodiment, and involved action and module are not necessarily of the invention It is necessary.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation The method of example can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but it is very much In the case of the former be more preferably embodiment.Based on this understanding, technical scheme of the present invention is substantially in other words to existing The part that technology contributes can be expressed in the form of software products, which is stored in a storage Medium(Such as ROM/RAM, magnetic disc, CD)In, including some instructions use is so that a station terminal equipment(It can be mobile phone, calculate Machine, server or network equipment etc.)Execute the method described in each embodiment of the present invention.
Embodiment 2
According to embodiments of the present invention, one kind is additionally provided for implementing the newer device of above-mentioned network flow, such as Fig. 7 institutes Show, which includes:
1)Acquiring unit 702, for obtaining the field for identifying the SIM card currently networked from the configuration file of terminal Value, wherein the first SIM card and the second SIM card are at least configured in terminal, the first SIM card and the second SIM card correspond to identical Network card identification;
Optionally, above-mentioned network flow update method is applied to various terminals in the present embodiment, for example, mobile phone, tablet Computer.Certainly, the citing of above-mentioned terminal is a kind of example, and the application does not limit this.
Optionally, the terminal in the present embodiment may include at least two SIM cards, for example, two SIM cards or three SIM card, the application do not limit this.
Optionally, the operating status of double card double standby mobile phone includes but not limited to following at least one in the present embodiment: SIM1 enablings SIM2 is deactivated, SIM1 deactivates SIM2 enablings, SIM1 work SIM2 is standby, the standby SIM2 of SIM1 work.Optionally, on Which SIM card state that different operating statuses can indicate currently to network is, for example, operating status " SIM1 enables SIM2 and deactivates " What is indicated is that currently to network is SIM1.
It is described by taking mobile phone as an example, the first SIM card and the second SIM card is configured on mobile phone, the corresponding card slot of two cards has Identical network card identification obtains the value of the field for identifying the SIM card currently networked from the configuration file of mobile phone.It is optional Ground, the field for being used to identify the SIM card currently networked in the present embodiment include but not limited to:One field, two fields or More than two fields.
For example, in conjunction with shown in (a)-(b) in Fig. 2, described by taking mobile phone A as an example, the first SIM card is configured in mobile phone A SIM1 and the second SIM card SIM2(As shown in phantom in FIG.), the corresponding identical network card identification of two cards(For example, mark is sim_ logo), the file in mobile phone includes but not limited to:Configuration file(For example, file), audio file(For example, media), picture File(For example, picture), wherein configuration file(For example, file)Include field dual_sim_mode_setting, Value can be but be not limited to:1,2, wherein field dual_sim_mode_setting values are the SIM that 1 expression is currently networked Card is the first SIM card SIM1, and field dual_sim_mode_setting values are that the SIM card that 2 expressions are currently networked is second SIM card SIM2.
2)Judging unit 704 is that the first SIM card is still for judging that the value of field identifies the SIM card currently networked Second SIM card;
For example, obtaining the field for identifying the SIM card currently networked(For example, dual_sim_mode_setting)'s After value, judge its value for 1 or 2, wherein field dual_sim_mode_setting values are that 1 expression is currently networked SIM card is the first SIM card SIM1, and field dual_sim_mode_setting values are that the SIM card that 2 expressions are currently networked is the Two SIM card SIM2.
3)First updating unit 706 makes when the SIM card for currently networking in the value mark of field is the first SIM card It is updated with the web-based history flow of the first SIM card of variable quantity pair of the current network flow got;
Optionally, web-based history flow in the present embodiment includes but not limited to:Total web-based history flow, the first SIM The web-based history flow of card, the web-based history flow of the second SIM card.For example, total web-based history flow of mobile phone A is 20M, first The web-based history flow of SIM card is 15M, and the web-based history flow of the second SIM card is 5M.
For example, judgement obtains the field of SIM card(For example, dual_sim_mode_setting)Value be 1, i.e., currently The SIM card of networking is the first SIM card SIM1, then utilizes the history net of the first SIM card of variable quantity pair SIM1 of current network flow Network flow is updated.For example, detecting that current used network flow is 25M, then according to current used network flow Amount may determine that the variable quantity of current network flow is 5M with total web-based history flow, and the SIM card currently networked is learnt in judgement For the first SIM card SIM1, then it is updated using the web-based history flow of the first SIM card of the 5M variable quantities pair SIM1 got. Therefore, the web-based history flow of the first SIM card SIM1 of updated mobile phone A is 20M, the web-based history of the second SIM card SIM2 Flow is 5M, and total web-based history flow of mobile phone A is updated to current used network flow, that is, 25M.
4)Second updating unit 708 makes when the SIM card for currently networking in the value mark of field is the second SIM card It is updated with the web-based history flow of the second SIM card of variable quantity pair of the current network flow got.
For example, judgement obtains the field of SIM card(For example, dual_sim_mode_setting)Value be 2, i.e., currently The SIM card of networking is the second SIM card SIM2, then utilizes the history net of the second SIM card of variable quantity pair SIM2 of current network flow Network flow is updated.For example, detecting that current used network flow is 25M, then according to current used network flow Amount may determine that the variable quantity of current network flow is 5M with total web-based history flow, and the SIM card currently networked is learnt in judgement For the second SIM card SIM2, then it is updated using the web-based history flow of the second SIM card of the 5M variable quantities pair SIM2 got. Therefore, the web-based history flow of the first SIM card SIM1 of updated mobile phone A is 15M, the web-based history of the second SIM card SIM2 Flow is 10M, and total web-based history flow of mobile phone A is updated to current used network flow, that is, 25M.
By embodiment provided by the present application, using in the configuration file of terminal for identifying the SIM card currently networked The value of field is judged to distinguish the SIM card currently networked, and then is gone through to corresponding SIM card using the variable quantity of network flow History network flow is updated, and double card double standby mobile phone is allow to more accurately distinguish between the variable quantity for the network flow for counting each card.
As a kind of optional scheme, as shown in figure 8, acquiring unit 702 includes:
1)Searching module 802 is used for from the type and/or terminal for installing lookup and terminal in adaptation file in the terminal The corresponding field for identifying the SIM card currently networked of operating system of upper operation;
Optionally, the type of terminal in the present embodiment can be, but not limited to be divided according to production firm, wherein mobile phone Manufacturer includes but not limited to:Samsung, apple, Nokia.Optionally, the system run in terminal in the present embodiment includes but not It is limited to:Apple IOS systems, Android android system, Windows Phone systems, Saipan Symbian system.
For example, in conjunction with shown in table 4, the adaptation file installed in the terminal may include the following contents:
Table 4
The type of terminal The system run in terminal Field for identifying the SIM card currently networked
Samsung Android android system dual_sim_mode_setting
Apple Apple IOS systems dual_sim_mode_setting_ios
Nokia Saipan Symbian system dual_sim_mode_setting_symbian
As shown in table 4, it can find in the adaptation file in terminal and to be run in type and/or terminal with terminal The corresponding field for identifying the SIM card currently networked of operating system.
For example, mobile phone A is Samsung mobile phone, the system of operation is Android android system, wherein the configuration text of the system Field in part for identifying the SIM card currently networked is dual_sim_mode_setting,.Under the scene, used obtaining When the field for the SIM card that mark is currently networked, it can be found in the adaptation file mounted on mobile phone and above-mentioned terminal Type and the corresponding field for identifying the SIM card currently networked of aforesaid operations system, for example, can by searching for above-mentioned table 4 To find for identifying the field for the SIM card currently networked as dual_sim_mode_setting.
2)Acquisition module 804, the value for obtaining field from the configuration file of terminal.
For example, being described so that mobile phone A is Samsung mobile phone as an example, the system of operation is Android android system, according in mobile phone Adaptation file in find the mobile phone for identify the SIM card currently networked field be dual_sim_mode_setting, The value of field dual_sim_mode_setting is then obtained to the configuration file of mobile phone.
By embodiment provided by the present application, searched in type and/or terminal with terminal from the adaptation file of terminal The corresponding field for identifying the SIM card currently networked of operating system of operation, then obtain the word to the configuration file of terminal The value of section, can directly acquire different terminals type in this way, and the SIM card in different operating systems is used to identify the word of networking Section, realizes and obtains different fields in real time according to demand, and then the more accurately effect of the variable quantity of network flow calculation.
As a kind of optional scheme, as shown in figure 9, judging unit 704 includes at least one of:
1)The value of first judgment module 902, the first field for including according to field judges the SIM card currently networked Still it is the second SIM card for the first SIM card;
Optionally, the field for being used to identify the SIM card currently networked in the present embodiment is a field(For example, first Field:dual_sim_mode_setting), when the application is not limited only to this, the field for identifying the SIM card currently networked Can also include two fields or more than two fields.
For example, by taking mobile phone A is Samsung mobile phone as an example, the system of operation is Android android system, and the mobile phone is for identifying First field of the SIM card currently networked is dual_sim_mode_setting, judges current networking according to the value of the field SIM card be the first SIM card SIM1 be still the second SIM card SIM2.
In conjunction with shown in table 5, it may determine that according to the value of the first field dual_sim_mode_setting and currently to network SIM card is that the first SIM card is still the second SIM card, it may also be used for judges the operating status of current phone:
Table 5
As seen from the above table, if judging to show that the first field dual_sim_mode_setting values are 1, judgement is sold The current operating status of machine is that SIM1 work SIM2 is standby, and the SIM card that this expression is currently networked is the first SIM card SIM1;If sentencing It is disconnected to show that the first field dual_sim_mode_setting values are 2, then judge that the current operating status of mobile phone waits for for SIM1 Machine SIM2 work, the SIM card that this expression is currently networked are the second SIM card SIM2;If judgement obtains the first field dual_sim_ Mode_setting values are 3, then judge that the current operating status of mobile phone is that SIM1 enablings SIM2 is deactivated, this indicates current connection The SIM card of net is the first SIM card SIM1;If judging to show that the first field dual_sim_mode_setting values are 4, sentence Break and the current operating status of mobile phone for the deactivated SIM2 enablings of SIM1, the SIM card that this expression is currently networked is the second SIM card SIM2。
2)The value of second judgment module 904, the second field and third field for being included at least according to field judges The SIM card currently networked is that the first SIM card is still the second SIM card.
For example, mobile phone A is described for Samsung mobile phone, the system of operation is Android android system, and the mobile phone is for marking The second field for knowing the SIM card currently networked is dual_sim_mode_setting, and third field is gprs_connection_ Setting may determine that the SIM card currently networked be the first SIM card SIM1 is still second according to the value of above-mentioned two field SIM card SIM2.
In conjunction with shown in table 6, according to the second field dual_sim_mode_setting and third field gprs_ of mobile phone The value of connection_setting, it can be determined that the SIM card currently networked is that the first SIM card is still the second SIM card, also It can be used for judging the operating status of current phone:
Table 6
As seen from the above table, if judge to show that the second field dual_sim_mode_setting values are 3, mobile phone Operating status can be " SIM1 work SIM2 is standby " or " the standby SIM2 work of SIM1 ", in such a case, it is possible to lead to again It crosses third field gprs_connection_setting and further judges which SIM card currently network is, if third field The value of gprs_connection_setting is 1, then judges that the current operating status of mobile phone is that SIM1 work SIM2 is waited for Machine, the SIM card that this expression is currently networked are the first SIM card SIM1;If judgement obtains third field gprs_connection_ Setting values are 2, then judge that the current operating status of mobile phone is the standby SIM2 work of SIM1, what this expression was currently networked SIM card is the second SIM card SIM2.
If judging to show that the second field dual_sim_mode_setting values are 1, the current operation of mobile phone is judged State is that SIM1 enablings SIM2 is deactivated, and the SIM card that this expression is currently networked is the first SIM card SIM1;If judgement obtains the second word Section dual_sim_mode_setting values are 2, then judge that the current operating status of mobile phone is that SIM1 deactivates SIM2 enablings, The SIM card that this expression is currently networked is the second SIM card SIM2.
By embodiment provided by the present application, using the judgement to field value, not only may be implemented to accurately distinguish statistics The statistics of the variable quantity of the network flow of first SIM card and the second SIM card can also realize the operation of identification double card double standby mobile phone State.
As a kind of optional scheme, the field in the device includes the first field, wherein judging unit 704 further includes:
1)Third judgment module, for judging whether the value of the first field is the first value, if the value of the first field is First value, then it represents that the first SIM card is currently at working condition, the second SIM card is currently at standby mode, and judges current The SIM card of networking is the first SIM card;
For example, in conjunction with shown in table 5, if judging to obtain the first field dual_sim_mode_setting values as the first value (For example, the first value is 1), then it represents that the current operating status of mobile phone is SIM1 work SIM2 SIM cards that are standby, and currently networking For the first SIM card SIM1.
2)4th judgment module, for judging whether the value of the first field is second value, if the value of the first field is Second value, then it represents that the first SIM card is currently at standby mode, the second SIM card is currently at working condition, and judges current The SIM card of networking is the second SIM card;
For example, in conjunction with shown in table 5, if judging to obtain the first field dual_sim_mode_setting values as second value (For example, second value is 2), then it represents that the current operating status of mobile phone works for the standby SIM2 of SIM1, and the SIM card currently networked For the second SIM card SIM2.
3)5th judgment module, for judging whether the value of the first field is third value, if the value of the first field is Third value, then it represents that the first SIM card is activated, the second SIM card is deactivated, and judges that the SIM card currently networked is the first SIM Card;
For example, in conjunction with shown in table 5, if judging to obtain the first field dual_sim_mode_setting values as third value (For example, third value is 3), then it represents that the current operating status of mobile phone enables SIM2 for SIM1 and deactivates, and the SIM card currently networked For the first SIM card SIM1.
4)6th judgment module, for judging whether the value of the first field is the 4th value, if the value of the first field is 4th value, then it represents that the first SIM card is deactivated, the second SIM card is activated, and judges that the SIM card currently networked is the 2nd SIM Card.
For example, in conjunction with shown in table 5, if judging to obtain the first field dual_sim_mode_setting values as the 4th value (For example, the 4th value is 4), then it represents that the current operating status of mobile phone is that SIM1 deactivates SIM2 enablings, and the SIM card currently networked For the second SIM card SIM2.
By embodiment provided by the present application, using the judgement to field value, not only may be implemented to accurately distinguish statistics The statistics of the variable quantity of the network flow of first SIM card and the second SIM card can also realize the operation of identification double card double standby mobile phone State.
As a kind of optional scheme, the field in the device includes the second field and third field, wherein judging unit 704 include:
1)7th judgment module, for judging whether the value of the second field is the 5th value, if the value of the second field is 5th value, then it represents that the first SIM card is currently at working condition, the second SIM card is currently at standby mode, alternatively, the first SIM Card is currently at standby mode, the second SIM card is currently at working condition;The case where the value of the second field is five value Under, judge that the value of third field be the 6th value is still the 7th value, if the value of third field is the 6th value, judges to work as The SIM card of preceding networking is the first SIM card, if the value of third field is the 7th value, judges that the SIM card currently networked is the Two SIM cards;
For example, in conjunction with shown in table 6, if judging to obtain the second field dual_sim_mode_setting values as the 5th value (For example, the 5th value is 3)When, then it represents that the first SIM card SIM1 is currently at working condition, the second SIM card SIM2 is currently at Standby mode, alternatively, the first SIM card SIM1 is currently at standby mode, the second SIM card is currently at working condition SIM2, base In the second field value be the 5th value(For example, the 5th value is 3)In the case of, then pass through third field gprs_connection_ Which SIM card what setting further judged currently to network is, if third field gprs_connection_setting's takes Value is the 6th value(For example, the 6th value is 1), then judge that the SIM card currently networked is the first SIM card;Third field gprs_ Connection_setting values are the 7th value(For example, the 7th value is 2), then judge that the SIM card currently networked is second SIM card.
2)8th judgment module, for judging whether the value of the second field is the 8th value, if the value of the second field is 8th value, then it represents that the first SIM card is activated, the second SIM card is deactivated, and judges that the SIM card currently networked is the first SIM Card;
For example, in conjunction with shown in table 6, judged by the value of the second field dual_sim_mode_setting, if the second word The value of section dual_sim_mode_setting is the 8th value(For example, the 8th value is 1), then it represents that the current operation shape of mobile phone State is that SIM1 enablings SIM2 is deactivated, and the SIM card currently networked is the first SIM card SIM1;
3)9th judgment module, for judging whether the value of the second field is the 9th value, if the value of the second field is 9th value, then it represents that the first SIM card is deactivated, the second SIM card is activated, and judges that the SIM card currently networked is the 2nd SIM Card.
For example, in conjunction with shown in table 6, judged by the value of the second field dual_sim_mode_setting, if the second word The value of section dual_sim_mode_setting is the 9th value(For example, the 9th value is 2), then it represents that the current operation shape of mobile phone State is that SIM1 deactivates SIM2 enablings, and the SIM card currently networked is the second SIM card SIM2.
By embodiment provided by the present application, using the judgement to field value, not only may be implemented to accurately distinguish statistics The statistics of the variable quantity of the network flow of first SIM card and the second SIM card can also realize the operation of identification double card double standby mobile phone State.
As a kind of optional scheme, as shown in Figure 10, which further includes:
1)First updating unit 706 includes:First update module 1002 is used for the web-based history flow of the first SIM card It is updated to the web-based history flow of the first SIM card and the sum of the variable quantity of current network flow;
Optionally, newest made can be obtained with the changes in flow rate of real-time monitoring terminal operating system in the present embodiment Network flow variable quantity.
For example, by taking mobile phone A as an example, it is assumed that total web-based history flow of the mobile phone is historyData, wherein is also set up One interim replacement variable tempData, current used network flow is newData, the history net of the first SIM card SIM1 Network flow is card1Data, and the web-based history flow of the second SIM card SIM2 is card2Data.
When monitoring that the network flow of mobile phone changes, then the variable quantity of network flow is calculated by the following formula:
tempData=newData–historyData (4)
Wherein, historyData is total web-based history flow of mobile phone;NewData is current used network flow; TempData is interim replacement variable.
If it is that the network flow of the first SIM card SIM1 changes to be learnt by judgement, will be according to following formula meter The first updated network flows of SIM card SIM1 are calculated, and the web-based history flow of the first SIM card SIM1 is updated to the first SIM Block the sum of the variable quantity of the web-based history flow and current network flow of SIM1:
card1Data’=card1Data+tempData (5)
Wherein, card1Data ' is the updated web-based history flows of the first SIM card SIM1, and card1Data is the first SIM Block the web-based history flow before SIM1 updates, tempData is interim replacement variable, and value is equal to the variable quantity of network flow.
For example, the web-based history flow historyData of mobile phone is 20M, the web-based history before the first SIM card SIM1 updates Flow card1Data is 15M, then the web-based history flow card2Data before the second SIM card SIM2 updates is 5M, has currently been made Network flow newData is 25M, and the interim variable tempData that replaces is 25-20=5M, and the SIM currently to network is learnt in judgement Card is the first SIM card SIM1, then the updated web-based history flows of the first SIM card SIM1 are:15+5=20M, and by the total of mobile phone Web-based history flow historyData is updated to current used network flow newData, as 25M.
2)Second updating unit 708 includes:Second update module 1004 is used for the web-based history flow of the second SIM card It is updated to the web-based history flow of the second SIM card and the sum of the variable quantity of current network flow.
If it is that the network flow of the second SIM card SIM2 changes to be learnt by judgement, will be according to following formula meter The updated web-based history flows of the second SIM card SIM2 are calculated, and the web-based history flow of the second SIM card SIM2 is updated to second The web-based history flow of SIM card SIM2 and the sum of the variable quantity of current network flow:
Card2Data’=card2Data+tempData (6)
Wherein, card2Data ' is the updated web-based history flows of the second SIM card SIM2, and card2Data is the 2nd SIM Block the web-based history flow before SIM2 updates, tempData is interim replacement variable, and value is equal to the variable quantity of network flow.
For example, total web-based history flow historyData of mobile phone is 20M, the history net before the first SIM card SIM1 updates Network flow card1Data is 15M, then the web-based history flow card2Data before the second SIM card SIM2 updates is 5M, currently The network flow newData used is 25M, and the interim variable tempData that replaces is 25-20=5M, judges to learn and currently network SIM card is the second SIM card SIM2, then the network flow of history is after the second SIM card SIM2 updates:5+5=10M, and by mobile phone Total web-based history flow historyData is updated to current used network flow newData, as 25M.
By embodiment provided by the present application, phase after being added into judgement using the variable quantity of the current network flow of acquisition In the SIM card currently networked answered, realizes in real time according to the corresponding field of different terminals, accurately distinguish statistics double-card dual-standby hand The network flow variable quantity that machine respectively blocks.
The embodiments of the present invention are for illustration only, can not represent the quality of embodiment.
In the above embodiment of the present invention, all emphasizes particularly on different fields to the description of each embodiment, do not have in some embodiment The part of detailed description may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed client, it can be by others side Formula is realized.Wherein, the apparatus embodiments described above are merely exemplary, for example, the unit division, only one Kind of division of logic function, formula that in actual implementation, there may be another division manner, such as multiple units or component can combine or It is desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed it is mutual it Between coupling, direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some interfaces, unit or module It connects, can be electrical or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can be stored in a computer read/write memory medium.Based on this understanding, technical scheme of the present invention is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment(Can be personal computer, server or network equipment etc.)Execute each embodiment the method for the present invention whole or Part steps.And storage medium above-mentioned includes:USB flash disk, read-only memory(ROM, Read-Only Memory), arbitrary access deposits Reservoir(RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. are various can store program code Medium.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (10)

1. a kind of network flow update method, which is characterized in that including:
It is searched from the adaptation file of installation in the terminal corresponding with the operating system run in the type of terminal and/or terminal Field for identifying the SIM card currently networked obtains the value of the field from the configuration file of the terminal, wherein The first SIM card and the second SIM card are at least configured in the terminal, first SIM card and second SIM card correspond to identical Network card identification;
Judge the value of the field to identify the SIM card currently networked be first SIM card to be still the 2nd SIM Card;
If it is first SIM card that the value of the field, which identifies the SIM card currently networked, current using what is got The variable quantity of network flow is updated the web-based history flow of first SIM card;
If it is second SIM card that the value of the field, which identifies the SIM card currently networked, described in getting The variable quantity of current network flow is updated the web-based history flow of second SIM card.
2. according to the method described in claim 1, it is characterized in that, the value mark for judging the field is described current The SIM card of net is that first SIM card is still that second SIM card includes:
The value for the first field for including according to the field judge the SIM card currently networked for first SIM card also It is for second SIM card;Or
The value of the second field and third field that are included at least according to the field judges the SIM card currently networked for institute It is second SIM card to state the first SIM card still.
3. according to the method described in claim 2, it is characterized in that, the field includes first field, the judgement institute Stating the value of field, to identify the SIM card currently networked be first SIM card is still that second SIM card includes:
Judge whether the value of first field is the first value, if the value of first field is first value, table Show that first SIM card is currently at working condition, second SIM card is currently at standby mode, and judges described work as The SIM card of preceding networking is first SIM card;
Judge whether the value of first field is second value, if the value of first field is the second value, table Show that first SIM card is currently at standby mode, second SIM card is currently at working condition, and judges described work as The SIM card of preceding networking is second SIM card;
Judge whether the value of first field is third value, if the value of first field is the third value, table Show that first SIM card is activated, second SIM card is deactivated, and judges that the SIM card currently networked is described the One SIM card;
Judge whether the value of first field is the 4th value, if the value of first field is the 4th value, table Show that first SIM card is deactivated, second SIM card is activated, and judges that the SIM card currently networked is described the Two SIM cards.
4. according to the method described in claim 2, it is characterized in that, the field includes second field and the third word Section, it is described to judge the value of the field to identify the SIM card currently networked be first SIM card to be still described second SIM card includes:
Judge whether the value of second field is the 5th value, if the value of second field is the 5th value, table Show that first SIM card is currently at working condition, second SIM card is currently at standby mode, alternatively, described first SIM card is currently at standby mode, second SIM card is currently at working condition;It is institute in the value of second field In the case of stating the 5th value, judge that the value of the third field be the 6th value is still the 7th value, if the third field Value is the 6th value, then judges that the SIM card currently networked is first SIM card, if the third field Value is the 7th value, then judges that the SIM card currently networked is second SIM card;
Judge whether the value of second field is the 8th value, if the value of second field is the 8th value, table Show that first SIM card is activated, second SIM card is deactivated, and judges that the SIM card currently networked is described the One SIM card;
Judge whether the value of second field is the 9th value, if the value of second field is the 9th value, table Show that first SIM card is deactivated, second SIM card is activated, and judges that the SIM card currently networked is described the Two SIM cards.
5. according to the method described in claim 1, it is characterized in that,
The variable quantity using the current network flow got is updated the web-based history flow of first SIM card Including:By the web-based history flow of first SIM card be updated to the web-based history flow of first SIM card with it is described current The sum of variable quantity of network flow;
The variable quantity using the current network flow got is updated the web-based history flow of second SIM card Including:By the web-based history flow of second SIM card be updated to the web-based history flow of second SIM card with it is described current The sum of variable quantity of network flow.
6. a kind of network flow updating device, which is characterized in that including:
Acquiring unit, the acquiring unit include searching module and acquisition module, and the searching module is used for from mounted on terminal In adaptation file in search it is corresponding with the operating system run in the type of terminal and/or terminal described for identifying currently The field of the SIM card of networking;The acquisition module is used to obtain the value of the field from the configuration file of the terminal;Its In, the first SIM card and the second SIM card are at least configured in the terminal, first SIM card and second SIM card correspond to Identical network card identification;
Judging unit, for judge the value of the field identify the SIM card currently networked for first SIM card still For second SIM card;
First updating unit is first SIM card for identifying the SIM card currently networked in the value of the field When, the web-based history flow of first SIM card is updated using the variable quantity of the current network flow got;
Second updating unit is second SIM card for identifying the SIM card currently networked in the value of the field When, the web-based history flow of second SIM card is updated using the variable quantity of the current network flow got.
7. device according to claim 6, which is characterized in that the judging unit includes:
The value of first judgment module, the first field for including according to the field judges the SIM card currently networked Still it is second SIM card for first SIM card;Or
Second judgment module, the value of the second field and third field for being included at least according to the field judge described in work as The SIM card of preceding networking is that first SIM card is still second SIM card.
8. device according to claim 7, which is characterized in that the field includes first field, and the judgement is single Member further includes:
Third judgment module, for judging whether the value of first field is the first value, if the value of first field For first value, then it represents that first SIM card is currently at working condition, second SIM card is currently at standby shape State, and judge that the SIM card currently networked is first SIM card;
4th judgment module, for judging whether the value of first field is second value, if the value of first field For the second value, then it represents that first SIM card is currently at standby mode, second SIM card is currently at work shape State, and judge that the SIM card currently networked is second SIM card;
5th judgment module, for judging whether the value of first field is third value, if the value of first field For the third value, then it represents that first SIM card is activated, second SIM card is deactivated, and is judged described current The SIM card of net is first SIM card;
6th judgment module, for judging whether the value of first field is the 4th value, if the value of first field For the 4th value, then it represents that first SIM card is deactivated, second SIM card is activated, and is judged described current The SIM card of net is second SIM card.
9. device according to claim 7, which is characterized in that the field includes second field and the third word Section, the judging unit include:
7th judgment module, for judging whether the value of second field is the 5th value, if the value of second field For the 5th value, then it represents that first SIM card is currently at working condition, second SIM card is currently at standby shape State, alternatively, first SIM card is currently at standby mode, second SIM card is currently at working condition;Described In the case that the value of two fields is the 5th value, judge that the value of the third field be the 6th value is still the 7th value, If the value of the third field is the 6th value, judge that the SIM card currently networked is first SIM card, If the value of the third field is the 7th value, judge that the SIM card currently networked is second SIM card;
8th judgment module, for judging whether the value of second field is the 8th value, if the value of second field For the 8th value, then it represents that first SIM card is activated, second SIM card is deactivated, and is judged described current The SIM card of net is first SIM card;
9th judgment module, for judging whether the value of second field is the 9th value, if the value of second field For the 9th value, then it represents that first SIM card is deactivated, second SIM card is activated, and is judged described current The SIM card of net is second SIM card.
10. device according to claim 6, which is characterized in that further include:
First updating unit includes:First update module, for the web-based history flow of first SIM card to be updated to The web-based history flow of first SIM card and the sum of the variable quantity of the current network flow;
Second updating unit includes:Second update module, for the web-based history flow of second SIM card to be updated to The web-based history flow of second SIM card and the sum of the variable quantity of the current network flow.
CN201410010629.4A 2014-01-09 2014-01-09 Network flow update method and device Active CN104780528B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410010629.4A CN104780528B (en) 2014-01-09 2014-01-09 Network flow update method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410010629.4A CN104780528B (en) 2014-01-09 2014-01-09 Network flow update method and device

Publications (2)

Publication Number Publication Date
CN104780528A CN104780528A (en) 2015-07-15
CN104780528B true CN104780528B (en) 2018-09-04

Family

ID=53621699

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410010629.4A Active CN104780528B (en) 2014-01-09 2014-01-09 Network flow update method and device

Country Status (1)

Country Link
CN (1) CN104780528B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113055836B (en) * 2015-12-31 2022-12-27 柏思科技有限公司 Method and apparatus for using apparatus having multiple SIM cards

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101800792A (en) * 2010-01-12 2010-08-11 华为终端有限公司 Mobile phone internet traffic counting and displaying method and device, and mobile phone
CN101883356A (en) * 2010-06-21 2010-11-10 华为终端有限公司 Traffic prompt method and traffic prompt device
WO2013075428A1 (en) * 2011-11-23 2013-05-30 中兴通讯股份有限公司 Network selection method and device for multi-mode terminal
CN103281687A (en) * 2013-05-30 2013-09-04 北京小米科技有限责任公司 Network flow management method and device of double-card terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101800792A (en) * 2010-01-12 2010-08-11 华为终端有限公司 Mobile phone internet traffic counting and displaying method and device, and mobile phone
CN101883356A (en) * 2010-06-21 2010-11-10 华为终端有限公司 Traffic prompt method and traffic prompt device
WO2013075428A1 (en) * 2011-11-23 2013-05-30 中兴通讯股份有限公司 Network selection method and device for multi-mode terminal
CN103281687A (en) * 2013-05-30 2013-09-04 北京小米科技有限责任公司 Network flow management method and device of double-card terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于MTK Gemini平台的GPRS数据流量管家设计与实现;段琳;《中国优秀硕士学位论文全文数据库 信息科技辑 》;20121215;全文 *

Also Published As

Publication number Publication date
CN104780528A (en) 2015-07-15

Similar Documents

Publication Publication Date Title
CN103297099B (en) Bluetooth communication method and bluetooth communication equipment
CN104079680B (en) The recognition methods of equipment and device
CN104915306B (en) A kind of data manipulation control method and equipment manager
CN109962789B (en) Method and device for constructing Internet of things application label system based on network data
CN103490962A (en) Internet of Things access platform system and Internet of Things access method
CN103618792B (en) Data stream identification method and device
CN104270204A (en) Testing method and testing equipment for wireless communication module
CN107426800A (en) Reduce the method, apparatus and smart card of power consumption of terminal
CN104104560A (en) Monitoring method and device for application flow and mobile terminal
CN103731497A (en) Method for supporting wireless access to storage device and mobile route hot point device
CN108337739A (en) Establish method and device, the data processing method of wireless debugging connection
CN113191784A (en) Abnormal enterprise identification method and device, electronic equipment and storage medium
CN104780528B (en) Network flow update method and device
CN105824667A (en) Management method, device and system for storage equipment
CN105049452B (en) Switching method, device and the intelligent terminal of resource downloading mode
CN105959306A (en) IP address identification method and device
CN106612338A (en) Processing method and device of equipment identification information
CN108737487A (en) Method of data synchronization and device, storage medium and electronic device
CN108009036A (en) A kind of method and server for positioning the operation for causing data exception
CN106131238A (en) The sorting technique of IP address and device
CN112468368B (en) Method, device and system for automatically identifying communication protocol of electric meter and readable storage medium
CN110401934A (en) A kind of method of management equipment, management equipment and computer readable storage medium
CN104601823A (en) Intelligent terminal dual-card dual-standby function judgement method and system based on Android system
CN104951550B (en) Date storage method and device
CN108390912A (en) A kind of method and apparatus of multiport test data acquisition

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant