The method for controlling network flow and device of a kind of terminal device
Technical field
The present invention relates to automobile correlative technology field, the method for controlling network flow and dress of particularly a kind of terminal device
Put.
Background technology
In order that obtaining the content of terminal device can be upgraded in time, the terminal device of prior art can periodically pass through net
Network is communicated with background server, obtains data from background server to update the content inside terminal device, such as update
Video content, enable a user to obtain newest video content.
For the ease of renewal, terminal device can be communicated using mobile radio communication with background server.Use mobile radio communication
Needing to pay corresponding expense to operator, existing mode mainly pays exclusive monthly fee use to operator and obtains monthly payment flow,
Such as pay certain expense and obtain a month 6G flow, and need to pay extra charge afterwards more than this 6G flow.
Therefore, prior art can typically control the quantity updated the data within monthly payment flow to avoid extra charge.
However, inventor has found during invention is realized, prior art only controls the quantity of new data in monthly payment stream
To avoid extra charge within amount, often cause flow renewal deficiency for this, so as to cause the waste of flow.
The content of the invention
Based on this, it is necessary to the quantity of new data is only controlled for prior art within monthly payment flow to avoid surcharge
With, easily cause flow waste technical problem, there is provided the method for controlling network flow and device of a kind of terminal device.
The embodiment of the present invention provides a kind of method for controlling network flow of terminal device, including:
Asked in response to renewal, obtain current time;
If current time is the last time renewal time of current metering period, it is determined that residue allows flow value to be pre-
What if total flow threshold value subtracted the current metering period use flow value, from the renewal of remaining permission flow value described in Network Capture
Data are updated.
Further, asked described in response to renewal, after obtaining current time, methods described also includes:
If current time is not the last time renewal time of current metering period, and if has currently measured the period
It is less than the total flow threshold value using flow value, then updates the data and be updated from Network Capture.
Further, if the current time is not the last time renewal time of current metering period, and if
The current metering period is less than the total flow threshold value using flow value, then updates the data and be updated from Network Capture, has
Body includes:
If current time is not the last time renewal time of current metering period, and if has currently measured the period
It is less than the total flow threshold value using flow value, it is determined that current to allow to update flow value be the total flow threshold value divided by current
The permission update times of period are measured, currently allow updating the data for renewal flow value to carry out more from Network Capture no more than described
Newly.
Further, it is described update the data to update the data including the first kind updated the data with the second class, the first kind
The priority updated the data updates the data higher than second class, and described updated the data from Network Capture is updated, specific bag
Include:
Update the data and be updated from the first kind described in Network Capture.
Further, it is described to allow updating the data for flow value to be updated from remaining described in Network Capture, specific bag
Include:
Updated the data from the first kind described in Network Capture and/or second class is updated the data and is updated, it is acquired
The total amount that the first kind updates the data and/or second class updates the data is the remaining permission flow value.
The embodiment of the present invention provides a kind of control of network flow quantity device of terminal device, including:
Ask respond module is updated, is used for:Asked in response to renewal, obtain current time;
Final updating module, is used for:If current time is the last time renewal time of current metering period, it is determined that
Residue allow flow value be default total flow threshold value subtract the current metering period use flow value, from surplus described in Network Capture
Remaining updating the data for flow value of permission is updated.
Further, after the renewal request module, described device also includes:
Early stage, update module, was used for:If current time is not the last time renewal time of current metering period, and such as
What fruit currently measured the period is less than the total flow threshold value using flow value, then updates the data and be updated from Network Capture.
Further, update module early stage, is specifically used for:
If current time is not the last time renewal time of current metering period, and if has currently measured the period
It is less than the total flow threshold value using flow value, it is determined that current to allow to update flow value be the total flow threshold value divided by current
The permission update times of period are measured, currently allow updating the data for renewal flow value to carry out more from Network Capture no more than described
Newly.
Further, it is described update the data to update the data including the first kind updated the data with the second class, the first kind
The priority updated the data updates the data higher than second class, and described updated the data from Network Capture is updated, specific bag
Include:
Update the data and be updated from the first kind described in Network Capture.
Further, it is described to allow updating the data for flow value to be updated from remaining described in Network Capture, specific bag
Include:
Updated the data from the first kind described in Network Capture and/or second class is updated the data and is updated, it is acquired
The total amount that the first kind updates the data and/or second class updates the data is the remaining permission flow value.
The embodiment of the present invention from remaining described in Network Capture by when the last time of currently metering period updates, allowing
Updating the data for flow value is updated, and so as to avoid wasting monthly payment flow, is cut operating costs.
Brief description of the drawings
Fig. 1 is a kind of workflow diagram of the method for controlling network flow for terminal device that one embodiment of the invention provides;
Fig. 2 is a kind of workflow of the method for controlling network flow for terminal device that alternative embodiment of the present invention provides
Figure;
Fig. 3 is a kind of workflow of the method for controlling network flow for terminal device that another alternative embodiment of the present invention provides
Cheng Tu;
Fig. 4 is a kind of apparatus module figure of the control of network flow quantity device for terminal device that one embodiment of the invention provides;
Fig. 5 is a kind of apparatus module of the control of network flow quantity device for terminal device that alternative embodiment of the present invention provides
Figure;
Fig. 6 is the electronic equipment of the method for controlling network flow for the execution terminal device that alternative embodiment of the present invention provides
Hardware architecture diagram.
Embodiment
The present invention will be further described in detail with specific embodiment below in conjunction with the accompanying drawings.
Embodiment one
A kind of workflow of the method for controlling network flow of the terminal device provided as shown in Figure 1 for one embodiment of the invention
Cheng Tu, including:
Step S101, asked in response to renewal, obtain current time;
Step S102, if current time is the last time renewal time of current metering period, it is determined that residue allows
Flow value be default total flow threshold value subtract the current metering period use flow value, allow to flow from residue described in Network Capture
Updating the data for value is updated.
Terminal device can be the various equipment using mobile communication flow bag, such as mobile phone etc..Terminal device have with
The function of background server interaction, video frequency program can be obtained, carry out the function such as game interaction or advertisement pushing.Terminal device leads to
Network is crossed to communicate with background server
In order to obtain newest data, terminal device can be periodically updated, and can produce renewal request, triggering when updated
Step S101, current time is obtained, judge whether current time is currently to measure the last time of period more in step s 102
The new time.
The period is measured according to the difference of flow package, can be the units such as the moon, ten days, day, week.For example, if monthly payment stream
Amount, then it is month to measure the period, and the current metering period is then current month, if bag ten days, then it is ten days to measure the period, current meter
The amount period is current ten days.
Generally, for monthly payment flow, terminal device can be updated weekly, if current time is last
Week, then it is current metering period last time renewal time.Now, it is determined that remaining allow flow value.Default total flow threshold
Value can subtract reserved user for monthly payment flow and use flow online, for example, monthly payment flow is 6G, then it is online to reserve user
The use of flow is 1G, remaining 5G is as total flow threshold value, and after preventing that renewal from finishing, terminal device does not have enough flows
On-line funchon is used to user, or user is using can increase extra charge during On-line funchon.In addition, total flow threshold value can lead to
Cross setting to be adjusted, to adapt to the adjustment of monthly payment flow.
The current metering period can be obtained using flow value from terminal device, can be started in each metering period
When be zeroed out, then for statistics using the quantity of network traffics, residue allows flow value to be default total flow within the metering period
What threshold value subtracted the current metering period use flow, by from remaining permission flow value described in Network Capture update the data into
Row renewal so that residual flow can be completely used for being updated within the currently last time renewal time of metering period.
The embodiment of the present invention from remaining described in Network Capture by when the last time of currently metering period updates, allowing
Updating the data for flow value is updated, and so as to avoid wasting monthly payment flow, is cut operating costs.
Embodiment two
It is illustrated in figure 2 a kind of work of the method for controlling network flow for terminal device that alternative embodiment of the present invention provides
Flow chart, including:
Step S201, asked in response to renewal, obtain current time;
Step S202, if current time is not the last time renewal time of current metering period, and if current meter
The amount period is less than the total flow threshold value using flow value, then updates the data and be updated from Network Capture.
Generally, for monthly payment flow, terminal device can be updated weekly, if current time is not last
One week, then step S203 is triggered, whether now only need to judge the current metering period exceedes total flow threshold using flow value
Value, allow to carry out network renewal if being not above.For example, for monthly payment flow, if total flow threshold value is 5G, judge
Whether current month uses flow value to allow network to update if being not above more than 5G.
Specifically, if current time is not the last time renewal time of current metering period, and if current metering
Period is less than the total flow threshold value using flow value, it is determined that current to allow renewal flow value to be the total flow threshold value
Divided by the permission update times of current metering period, it is no more than the current renewal number for allowing to update flow value from Network Capture
According to being updated.
For example, for monthly payment flow, total flow threshold value can be 5G, once updated weekly, then allow update times
For 4 times, i.e., it is 1.25G currently to allow to update flow value.
Step S203, if current time is the last time renewal time of current metering period, it is determined that residue allows
Flow value be default total flow threshold value subtract the current metering period use flow value, allow to flow from residue described in Network Capture
Updating the data for value is updated.
Wherein, step S202 and step S203 order only for the purposes of explanation, are not formed to right in the present embodiment
It is required that limitation.Those of ordinary skill in the art be to be understood that step S202 and step S203 order can exchange and
Do not influence actual effect.
The embodiment of the present invention from remaining described in Network Capture by when the last time of currently metering period updates, allowing
Updating the data for flow value is updated, and so as to avoid wasting monthly payment flow, is cut operating costs.Meanwhile for being not to work as
The last time more news of preceding metering period, then only need then allow to carry out network more no more than total flow threshold value
Newly, so as to upgrading in time.
Embodiment three
It is illustrated in figure 3 a kind of method for controlling network flow for terminal device that another alternative embodiment of the present invention provides
Workflow diagram, including:
Step S301, asked in response to renewal, obtain current time;
Step S302, if current time is not the last time renewal time of current metering period, and if current meter
The amount period is less than the total flow threshold value using flow value, then updates the data and be updated from the Network Capture first kind, institute
The priority that the first kind updates the data is stated to update the data higher than the second class.
There is provided for terminal device the background server updated the data will can update the data be divided into the first kind update the data and
Second class updates the data, and the priority that the first kind updates the data updates the data higher than the second class.
Specifically, it can be using time newer data or ageing require that strict data update as the first kind
Data, using the time it is more early or it is ageing require that not strict data update the data as the second class, so as to the metering period compared with
Updated in early renewal time, preferably update ageing to provide, and the second class updates the data, and can be left to the metering period
Last time renewal when be updated.
Step S302, if current time is the last time renewal time of current metering period, it is determined that residue allows
Flow value be default total flow threshold value subtract the current metering period use flow value, updated the data from the Network Capture first kind
And/or second class update the data and be updated, the total amount that the acquired first kind updates the data and/or the second class updates the data is
The remaining permission flow value.
If being currently that last time updates, updated the data because the renewal of early stage had obtained the first kind, therefore
During last time updates, also secondary sources can be updated simultaneously., can be by the particularly when residue allows flow value abundance
Renewal secondary sources after a kind of data have all updated.
Wherein, step S302 and step S303 order only for the purposes of explanation, are not formed to right in the present embodiment
It is required that limitation.Those of ordinary skill in the art be to be understood that step S302 and step S303 order can exchange and
Do not influence actual effect.
The embodiment of the present invention from remaining described in Network Capture by when the last time of currently metering period updates, allowing
Updating the data for flow value is updated, and so as to avoid wasting monthly payment flow, is cut operating costs.Meanwhile for different preferential
Updating the data for level is handled within different renewal times respectively, on the one hand ensure that renewal is ageing, on the other hand
Avoiding the low data of priority from can not being updated always causes data to overstock.
Example IV
A kind of device mould of the control of network flow quantity device of terminal device of one embodiment of the invention offer is provided
Block figure, including:
Ask respond module 401 is updated, is used for:Asked in response to renewal, obtain current time;
Final updating module 402, is used for:If current time is the last time renewal time of current metering period,
It is determined that it is remaining allow flow value be default total flow threshold value subtract the current metering period use flow value, from Network Capture institute
Remaining updating the data for flow value of permission is stated to be updated.
The embodiment of the present invention from remaining described in Network Capture by when the last time of currently metering period updates, allowing
Updating the data for flow value is updated, and so as to avoid wasting monthly payment flow, is cut operating costs.
Embodiment five
It is illustrated in figure 5 a kind of device of the control of network flow quantity device for terminal device that alternative embodiment of the present invention provides
Module map, including:
Ask respond module 501 is updated, is used for:Asked in response to renewal, obtain current time.
Early stage, update module 502, was used for:If current time is not the last time renewal time of current metering period,
And if the current metering period is less than the total flow threshold value using flow value, then update the data progress more from Network Capture
Newly.
Specifically, update module early stage 502, is specifically used for:If current time is not last of current metering period
Secondary renewal time, and if currently the metering period is less than the total flow threshold value using flow value, it is determined that currently permission
It is the total flow threshold value divided by the permission update times of current metering period to update flow value, is no more than from Network Capture described
It is current to allow updating the data for flow value of renewal to be updated.
Final updating module 503, is used for:If current time is the last time renewal time of current metering period,
It is determined that it is remaining allow flow value be default total flow threshold value subtract the current metering period use flow value, from Network Capture institute
Remaining updating the data for flow value of permission is stated to be updated.
The embodiment of the present invention from remaining described in Network Capture by when the last time of currently metering period updates, allowing
Updating the data for flow value is updated, and so as to avoid wasting monthly payment flow, is cut operating costs.Meanwhile for being not to work as
The last time more news of preceding metering period, then only need then allow to carry out network more no more than total flow threshold value
Newly, so as to upgrading in time.
Embodiment six
A kind of control of network flow quantity device for terminal device that another alternative embodiment of the present invention provides, including:
Ask respond module is updated, is used for:Asked in response to renewal, obtain current time.
Early stage, update module, was used for:If current time is not the last time renewal time of current metering period, and such as
What fruit currently measured the period is less than the total flow threshold value using flow value, then updates the data progress from the Network Capture first kind
Renewal, the priority that the first kind updates the data update the data higher than the second class.
Final updating module, is used for:If current time is the last time renewal time of current metering period, it is determined that
Residue allow flow value be default total flow threshold value subtract the current metering period use flow value, from the Network Capture first kind
Update the data and/or the second class is updated the data and is updated, the acquired first kind updates the data and/or the second class updates the data
Total amount remaining allow flow value to be described.
The embodiment of the present invention from remaining described in Network Capture by when the last time of currently metering period updates, allowing
Updating the data for flow value is updated, and so as to avoid wasting monthly payment flow, is cut operating costs.Meanwhile for different preferential
Updating the data for level is handled within different renewal times respectively, on the one hand ensure that renewal is ageing, on the other hand
Avoiding the low data of priority from can not being updated always causes data to overstock.
Seventh embodiment of the invention provides a kind of nonvolatile computer storage media, and the computer-readable storage medium is deposited
Computer executable instructions are contained, the computer executable instructions can perform the terminal device in above-mentioned any means embodiment
Method for controlling network flow.
The electronics of the method for controlling network flow of the execution terminal device of eighth embodiment of the invention offer is provided
The hardware architecture diagram of equipment, it mainly includes:One or more processors 610, memory 620 etc., with one in Fig. 6
Exemplified by reason device 610.
Performing the electronic equipment of the method for controlling network flow of terminal device can also include:Input unit 630 and output
Device 640.
Processor 610, memory 620, input unit 630 and display device 640 can pass through bus or other modes
Connect, in Fig. 6 exemplified by being connected by bus.
Memory 620 is used as a kind of non-volatile computer readable storage medium storing program for executing, available for storage non-volatile software journey
Sequence, non-volatile computer executable program and module, such as the control of network flow quantity of the terminal device in the embodiment of the present application
Programmed instruction/module corresponding to method, for example, renewal ask respond module 401 and final updating module 402 shown in accompanying drawing 4.
Processor 610 is stored in non-volatile software program, instruction and module in memory 620 by operation, each so as to perform
Kind application of function and data processing, that is, realize the method for controlling network flow of the terminal device in above-described embodiment.
Memory 620 can include storing program area and storage data field, wherein, storing program area can store operation system
Application program required for system, at least one function;Storage data field can store to be filled according to the control of network flow quantity of terminal device
That puts uses created data etc..In addition, memory 620 can include high-speed random access memory, can also include non-
Volatile memory, for example, at least a disk memory, flush memory device or other non-volatile solid state memory parts.
In some embodiments, memory 620 is optional including relative to the remotely located memory of processor 610, these remote memories
The device of the method for controlling network flow of terminal device can be extremely performed by network connection.The example of above-mentioned network is included but not
It is limited to internet, intranet, LAN, mobile radio communication and combinations thereof.
The user that input unit 630 can receive input clicks on, and produces the control of network flow quantity device with terminal device
User set and function control it is relevant signal input.Display device 640 may include the display devices such as display screen, with display
More new content.
It is stored in one or more of modules in the memory 620, when by one or more of processing
When device 610 is run, the method for controlling network flow of the terminal device in above-mentioned any means embodiment is performed.
The said goods can perform the method that the embodiment of the present application is provided, and possesses the corresponding functional module of execution method and has
Beneficial effect.Not ins and outs of detailed description in the present embodiment, reference can be made to the method that the embodiment of the present application is provided.
The electronic equipment of the embodiment of the present invention exists in a variety of forms, includes but is not limited to:
(1) electronic control unit (Electronic Control Unit, ECU) is also known as " car running computer ", " vehicle-mounted computer "
Deng.Mainly by microprocessor (CPU), memory (ROM, RAM), input/output interface (I/O), analog-digital converter (A/D) and
The large scale integrated circuits such as shaping, driving form.
(2) mobile communication equipment:The characteristics of this kind equipment is that possess mobile communication function, and to provide speech, data
Communicate as main target.This Terminal Type includes:Smart mobile phone (such as iPhone), multimedia handset, feature mobile phone, and it is low
Hold mobile phone etc..
(3) super mobile personal computer equipment:This kind equipment belongs to the category of personal computer, there is calculating and processing work(
Can, typically also possess mobile Internet access characteristic.This Terminal Type includes:PDA, MID and UMPC equipment etc., such as iPad.
(4) portable entertainment device:This kind equipment can show and play content of multimedia.The kind equipment includes:Audio,
Video player (such as iPod), handheld device, e-book, and intelligent toy and portable car-mounted navigation equipment.
(5) server:The equipment for providing the service of calculating, the composition of server are total including processor, hard disk, internal memory, system
Line etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, therefore in processing energy
Power, stability, reliability, security, scalability, manageability etc. require higher.
(6) other electronic installations with data interaction function.
In addition, the logical order in above-mentioned memory 620 can be realized and be used as by the form of SFU software functional unit
Independent production marketing in use, can be stored in a computer read/write memory medium.Based on such understanding, sheet
The part or the part of the technical scheme that the technical scheme of invention substantially contributes to prior art in other words can be with
The form of software product is embodied, and the computer software product is stored in a storage medium, including some instructions to
So that a mobile terminal (can be personal computer, server, or network equipment etc.) performs each embodiment of the present invention
The all or part of step of methods described.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM,
Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. it is various
Can be with the medium of store program codes.
Device embodiment described above is only schematical, wherein the unit illustrated as separating component can
To be or may not be physically separate, it can be as the part that unit is shown or may not be physics list
Member, you can with positioned at a place, or can also be distributed on multiple NEs.It can be selected according to the actual needs
In some or all of module realize the purpose of scheme of the embodiment of the present invention.Those of ordinary skill in the art are not paying wound
In the case of the work for the property made, you can to understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
Realized by the mode of software plus required general hardware platform, naturally it is also possible to pass through hardware.Based on such understanding, on
The part that technical scheme substantially in other words contributes to prior art is stated to embody in the form of software product, should
Computer software product can store in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD, including some fingers
Make to cause a computer equipment (can be personal computer, server, or network equipment etc.) to perform each implementation
Method described in some parts of example or embodiment.
Finally it should be noted that:Above example is only to illustrate the technical scheme of the embodiment of the present invention, rather than it is limited
System;Although the embodiment of the present invention is described in detail with reference to the foregoing embodiments, one of ordinary skill in the art should
Understand:It can still modify to the technical scheme described in foregoing embodiments, or to which part technical characteristic
Carry out equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention skill
The spirit and scope of art scheme.