CN108282410A - Background traffic control method, device, storage medium and user terminal - Google Patents

Background traffic control method, device, storage medium and user terminal Download PDF

Info

Publication number
CN108282410A
CN108282410A CN201710539970.2A CN201710539970A CN108282410A CN 108282410 A CN108282410 A CN 108282410A CN 201710539970 A CN201710539970 A CN 201710539970A CN 108282410 A CN108282410 A CN 108282410A
Authority
CN
China
Prior art keywords
application program
flow
network
value
unit
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.)
Pending
Application number
CN201710539970.2A
Other languages
Chinese (zh)
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.)
Alibaba China Co Ltd
Original Assignee
Guangzhou Dongjing Computer Technology 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 Guangzhou Dongjing Computer Technology Co Ltd filed Critical Guangzhou Dongjing Computer Technology Co Ltd
Priority to CN201710539970.2A priority Critical patent/CN108282410A/en
Publication of CN108282410A publication Critical patent/CN108282410A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/29Flow control; Congestion control using a combination of thresholds

Abstract

An embodiment of the present invention provides a kind of background traffic control method, device, storage medium and user terminals, are related to Internet technical field.The method includes when application program initiates network request, detecting whether the application program currently operates in backstage;If the application program is currently operating at backstage, the flow value that the application program has been received and dispatched under background state is obtained;Judge whether the flow value is more than preset flow threshold value again, if be less than preset flow threshold value, obtain the time span that the application program has been run under background state, judge whether the time span is more than preset time threshold, if being more than the preset time threshold, forbid the network request.By the relationship for judging the flow value that application program has been received and dispatched under background state or the time span and threshold value that have been run under background state, to decide whether to allow network request, it avoids backstage is excessive from expending flow with this, flow is effectively saved to realize.

Description

Background traffic control method, device, storage medium and user terminal
Technical field
The present invention relates to Internet technical fields, in particular to a kind of background traffic control method, device, storage Medium and user terminal.
Background technology
With universal and mobile Internet the development of intelligent terminal, mobile terminal app plays the part of more next in people's lives More important role.Present mobile network's speed is getting faster, and mobile terminal app is also increasing to the flow of consumption.Institute How to save customer flow, just become the problem of needing concern at present.
Invention content
In view of this, the embodiment of the present invention is designed to provide a kind of background traffic control method, device, storage medium And user terminal, to solve the above problems.To achieve the goals above, the technical solution that the embodiment of the present invention is taken is as follows:
In a first aspect, an embodiment of the present invention provides a kind of background traffic control method, the method includes:When using journey When sequence initiates network request, detect whether the application program currently operates in backstage;If the application program is currently operating at From the background, the flow value that the application program has been received and dispatched under background state is obtained;Judge whether the flow value is more than default If it is long to obtain the time that the application program has been run under background state be less than preset flow threshold value for flow threshold Degree judges whether the time span is more than that preset time threshold forbids the network to ask if being more than the preset time threshold It asks.
Second aspect, an embodiment of the present invention provides a kind of background traffic control device, the background traffic control device Forbid list including detection unit, flow acquiring unit, the first judging unit, time acquisition unit, second judgment unit and first Member.Detection unit, for when application program initiates network request, detecting whether the application program currently operates in backstage. Flow acquiring unit, for when the detection unit is detected as being, obtaining the application program and having been received under background state The flow value of hair.First judging unit, for judging whether the flow value is more than preset flow threshold value.Time acquisition unit, For when first judging unit is judged as NO, it is long to obtain the time that the application program has been run under background state Degree.Second judgment unit, for judging whether the time span is more than preset time threshold.First forbids unit, for working as When the second judgment unit is judged as NO, forbid the network request.
The third aspect, an embodiment of the present invention provides a kind of storage medium, the storage medium is stored with processor and can hold Capable program code, said program code are configured to that the processor is made to execute the above method.
Fourth aspect, an embodiment of the present invention provides a kind of user terminal, the user terminal includes processor and storage Device, the processor and the memory are electrically connected by bus;The memory is for storing program;The processor is used In calling the program being stored in the memory by the bus, execute:When application program initiates network request, detection Whether the application program currently operates in backstage;If the application program is currently operating at backstage, the application program is obtained The flow value received and dispatched under background state;Judge whether the flow value is more than preset flow threshold value, if being less than default When flow threshold, the time span that the application program has been run under background state is obtained, judges that the time span is No is more than that preset time threshold forbids the network request if being more than the preset time threshold.
An embodiment of the present invention provides a kind of background traffic control method, device, storage medium and user terminals, by sentencing The disconnected application program flow value received and dispatched under background state or the time span and threshold value that have been run under background state Relationship avoid backstage is excessive to expend flow to decide whether to allow network request with this, stream be effectively saved to realize Amount.
Other features and advantages of the present invention will be illustrated in subsequent specification, also, partly be become from specification It is clear that by implementing understanding of the embodiment of the present invention.The purpose of the present invention and other advantages can be by saying what is write Specifically noted structure is realized and is obtained in bright book, claims and attached drawing.
Description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only certain embodiments of the present invention, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is a kind of structure diagram of user terminal provided in an embodiment of the present invention;
Fig. 2 is the flow chart for the background traffic control method that first embodiment of the invention provides;
Fig. 3 is the flow chart for the background traffic control method that second embodiment of the invention provides;
Fig. 4 is the structure diagram for the background traffic control device that third embodiment of the invention provides;
Fig. 5 is the structure diagram for the background traffic control device that fourth embodiment of the invention provides.
Specific implementation mode
Below in conjunction with attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete Ground describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Usually exist The component of the embodiment of the present invention described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause This, the detailed description of the embodiment of the present invention to providing in the accompanying drawings is not intended to limit claimed invention below Range, but it is merely representative of the selected embodiment of the present invention.Based on the embodiment of the present invention, those skilled in the art are not doing The every other embodiment obtained under the premise of going out creative work, shall fall within the protection scope of the present invention.
It should be noted that:Similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined, then it further need not be defined and explained in subsequent attached drawing in a attached drawing.Meanwhile the present invention's In description, term " first ", " second " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
Referring to Fig. 1, Fig. 1 shows a kind of structure diagram of user terminal 100 provided in an embodiment of the present invention.The use Family terminal 100 can be:PC (personal computer) computer, tablet computer, mobile phone, electronic reader, notebook electricity The terminal devices such as brain, smart television, set-top box, car-mounted terminal.Preferably, the user terminal 100 is mobile terminal, such as hand Machine can install applications client.As shown in Figure 1, user terminal 100 may include memory 110, storage control 111, Processor 112, Peripheral Interface 113, input-output unit 115, audio unit 116, display unit 117.
The memory 110, storage control 111, processor 112, Peripheral Interface 113, input-output unit 115, sound It is directly or indirectly electrically connected between frequency unit 116,117 each element of display unit, to realize the transmission or interaction of data.Example Such as, electrical connection can be realized by one or more communication bus or signal bus between these elements.Background traffic controlling party Method respectively includes at least one software function that can be stored in the form of software or firmware (firmware) in memory 110 Module, such as software function module or computer program that the background traffic control device includes.
Memory 110 can store various software programs and module, such as background traffic control provided by the embodiments of the present application Corresponding program instruction/the module of method and device processed.Processor 112 is by running the software program of storage in the memory 110 And module realizes the background traffic control in the embodiment of the present application to perform various functions application and data processing Method.Memory 110 can include but is not limited to random access memory (Random Access Memory, RAM), read-only to deposit Reservoir (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electric erasable Read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM) etc..
Processor 112 can be a kind of IC chip, have signal handling capacity.Above-mentioned processor can be general Processor, including central processing unit (Central Processing Unit, abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (DSP), application-specific integrated circuit (ASIC), ready-made programmable Gate array (FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware components.It can To realize or execute disclosed each method, step and the logic diagram in the embodiment of the present application.General processor can be micro- Processor or the processor can also be any conventional processor etc..
The Peripheral Interface 113 couples various input/output devices to processor 112 and memory 110.At some In embodiment, Peripheral Interface 113, processor 112 and storage control 111 can be realized in one single chip.Other one In a little examples, they can be realized by independent chip respectively.
The interaction that input-output unit 115 is used to that user input data to be supplied to realize user and user terminal 100.It is described Input-output unit 115 may be, but not limited to, mouse and keyboard etc..
Audio unit 116 provides a user audio interface, may include that one or more microphones, one or more raises Sound device and voicefrequency circuit.
Display unit 117 provides an interactive interface (such as user's operation circle between the user terminal 100 and user Face) or for display image data give user reference.In the present embodiment, the display unit 117 can be liquid crystal display Or touch control display.Can be the capacitance type touch control screen or resistance for supporting single-point and multi-point touch operation if touch control display Formula touch screen etc..Single-point and multi-point touch operation is supported to refer to touch control display and can sense on the touch control display one Or at multiple positions simultaneously generate touch control operation, and by the touch control operation that this is sensed transfer to processor 112 carry out calculate and Processing.
It is appreciated that structure shown in FIG. 1 is only to illustrate, user terminal 100 may also include it is more than shown in Fig. 1 or Less component, or with the configuration different from shown in Fig. 1.Each component shown in Fig. 1 may be used hardware, software or its Combination is realized.
In the embodiment of the present invention, client is installed in user terminal 100, which can be that browser can also It is third-party application software, it is corresponding with server (Server) end.
First embodiment
Referring to Fig. 2, an embodiment of the present invention provides a kind of background traffic control method, the method includes:
Step S200:When application program initiates network request, detect whether the application program currently operates in backstage;
As an implementation, by match pre-set status indicator detect the application program currently whether Backstage is operated in, the status indicator can carry out corresponding state value update as the front and back of the application program switches. For example, the application program is switched to foreground and background state, the background traffic control device where the application program is notified, Background traffic control device obtains the application program and is currently operating at foreground or backstage;Meanwhile background traffic control device is deposited The state such as backstage and corresponding current time that presently described application program is run are stored up.
In embodiments of the present invention, background traffic control device can be WebView SDK, or independently of The management software of WebView SDK.Wherein, WebView is a kind of system component that intelligent operating system provides, and can complete net The function of page loaded and displayed, specific interface and function depend on the version of intelligent operating system.
And WebView SDK are that WebView is externally provided to server component and the WebView of system to have in the form of SDK Similar function, but normalized service can be provided, do not depend on intelligent operating system.Mobile client (app) be based on WebView components run on the application program of mobile terminal.In the present embodiment, where the background traffic control device Application program can be to run on the application program of mobile terminal, such as Jingdone district App, day cat APP.Before mobile app is switched to When platform, it is shown to user and server communication, is operated for user, the content in mobile app is browsed;When mobile app switchings When to backstage, it is not shown to user, still and server communication, the message of server transmission can be received.
For WebView SDK, the WebView SDK where application program by match pre-set status indicator come Whether the application program where detecting it currently operates in backstage.For example, application program is switched to foreground and background state, notice The WebView SDK, WebView SDK obtain the application program and are currently operating at foreground or backstage;Meanwhile WebView SDK stores the state such as backstage and corresponding current time that presently described application program is run.
Step S210:If the application program is currently operating at backstage, the application program is obtained under background state Flow value through transmitting-receiving;
The flow value includes:
The application program is obtained under background state, the flow and reception that the application program transmission data is consumed The flow that data are consumed.
Step S220:Judge whether the flow value is more than preset flow threshold value;
The preset flow threshold value can be set according to actual conditions.If for example, the flow that the application program expends Compare it is more, then by the value of preset flow threshold value be arranged it is larger, for example, 3M.If answering where the background traffic control device The flow expended with program is fewer, then the setting of the value of preset flow threshold value is smaller, for example, 1M.If the flow value is super When crossing preset flow threshold value, forbid the network request.
Step S230:If be less than preset flow threshold value, obtain the application program and run under background state Time span;
Step S240:Judge whether the time span is more than preset time threshold;
The preset time threshold can be set according to actual conditions.For example, where the background traffic control device Application program be instant message applications, such as mobile phone QQ, wechat, then by the longer of preset time threshold setting, such as 5 minutes. If the application program where the background traffic control device is not instant message applications, such as mobile phone Taobao, then by preset time Threshold value is arranged shorter, such as 1 minute.
Step S250:If being more than the preset time threshold, forbid the network request.
The method further includes:
Step S260:Allow the network request.
Specifically, when application program initiate network request when, detect the application program currently without operate in backstage The i.e. described application program is currently operating at foreground, allows the network request.Further, background traffic control device obtains institute When stating the flow value that application program has been received and dispatched under background state and being not above preset flow threshold value, the application program is rear When the time span run under mesa-shaped state is less than preset time threshold, then allow the network request of the application program. Avoid backstage is excessive from expending flow with this.
A kind of background traffic control method that present example provides, has been received by judging application program under background state The relationship of the flow value of hair or the time span and threshold value that have been run under background state, to decide whether that network is allowed to ask It asks, avoids backstage is excessive from expending flow with this, flow is effectively saved to realize.It realizes from flow and time dual dimension Degree, is effectively saved flow, while saving electricity.
Second embodiment
Referring to Fig. 3, an embodiment of the present invention provides a kind of background traffic control method, the method includes:
Step S300:When application program initiates network request, detect whether the application program currently operates in backstage;
As an implementation, by match pre-set status indicator detect the application program currently whether Backstage is operated in, the status indicator can carry out corresponding state value update as the front and back of the application program switches.
Step S310:If the application program is currently operating at backstage, the user terminal where the application program is obtained Network state information;
Step S320:Obtain the flow value that the application program has been received and dispatched under background state;
The flow value includes:
The application program is obtained under background state, the flow and reception that the application program transmission data is consumed The flow that data are consumed.
When the application program is under background state, initiates network request every time, background traffic control device obtains simultaneously Preserve the flow consumed described in current network state information, transmission data;When background traffic control device receives network response Afterwards, the background traffic control device, which obtains, receives the flow that data are consumed.If the application program is not located in rear mesa-shaped Under state, background traffic control device can reset the flow consumed described in the transmission data of backstage record and reception data, once The application program is in background state, and background traffic control device can reacquire and preserve the flow that transmission data is consumed And the flow that data are consumed is received, so it is cyclically updated.
Step S300, step S320 is similar with the step S200- steps S210 in first embodiment, and which is not described herein again.
Step S330:Judge whether the flow value is more than preset flow threshold value;
As an implementation, judge whether the flow value is more than the corresponding preset flow of the network state information Threshold value.
Further, the network state information can include but is not limited to the user terminal be based on 2G network formats into Row network communication, the user terminal are based on 3G network standard and carry out network communication, the user terminal based on 4G network formats Network communication, the user terminal are carried out based on a kind of network communication in the progress network communication of Wifi network formats.Correspondingly, The corresponding preset flow threshold value of the 2G network formats is 100kb, and the corresponding preset flow threshold value of the 3G network standard is 500kb, the corresponding preset flow threshold value of the 4G network formats are 1M, the corresponding preset flow threshold value of the Wifi network formats For infinity.It should be noted that each network communication corresponds to preset flow threshold value and can be arranged according to actual conditions.
Forbid the network request if the flow value is more than preset flow threshold value based on step S330.
For example, WebView SDK detect that current application program where it operates in backstage, current network state information It is based on 3G network standard for the user terminal where application program to carry out in network communication, gets the application program on backstage The flow value received and dispatched under state is 600kb, and 600kb is more than the corresponding preset flow threshold value of the 3G network standard such as 500kb then forbids WebView SDK network requests, avoids customer flow waste and there may be extra-pays.
Step S340:If be less than preset flow threshold value, obtain the application program and run under background state Time span;
Step S350:Judge whether the time span is more than preset time threshold;
As an implementation, when judging whether the time span is more than that the network state information is corresponding default Between threshold value.
Further, the network state information can include but is not limited to the user terminal be based on 2G network formats into Row network communication, the user terminal are based on 3G network standard and carry out network communication, the user terminal based on 4G network formats Network communication, the user terminal are carried out based on a kind of network communication in the progress network communication of Wifi network formats.Correspondingly, The corresponding preset time threshold of the 2G network formats is 2 minutes, and the corresponding preset time threshold of the 3G network standard is 1 point Clock, the corresponding preset time threshold of the 4G network formats are 30 seconds, the corresponding preset time threshold of the Wifi network formats For infinity.It should be noted that each network communication corresponds to preset flow threshold value and can be arranged according to actual conditions.
Step S360:If being more than the preset time threshold, forbid the network request.
For example, WebView SDK detect that current application program where it operates in backstage, current network state information It is based on 4G network formats for the user terminal where application program to carry out in network communication, gets the application program on backstage The flow value received and dispatched under state is 500kb, further gets what the application program had been run under background state Time span is 1 minute;It is more than the corresponding preset time threshold of the 4G network formats such as 30 seconds within 1 minute, also may be used within 1 minute at this time User to be construed to the user terminal does not need to the service of application program currently, is not required to flow waste to be invalid, then Forbid WebView SDK network requests, i.e., the unwanted network request of background user is intercepted, and then avoid invalid stream Amount waste.To be effectively saved the flow of user, while also saving the electricity of user.Improve the experience of user.Class Like the case where other network state informations, which is not described herein again.
The method can also include:
Step S370:Allow the network request.
Specifically, when application program initiate network request when, detect the application program currently without operate in backstage The i.e. described application program is currently operating at foreground, allows the network request.Further, background traffic control device obtains institute It states the flow value that application program has been received and dispatched under background state and is not above the corresponding preset flow of the network state information When threshold value, it is corresponding that time span that the application program has been run under background state is less than the network state information When preset time threshold, then allow the network request of the application program.Avoid backstage is excessive from expending flow with this.
A kind of background traffic control method provided in an embodiment of the present invention, passes through the user terminal where connected applications program Network state and judge flow value or transported under background state that the application program has been received and dispatched under background state The relationship of capable time span and threshold value avoids backstage is excessive from expending flow to decide whether to allow network request with this, to It realizes and is effectively saved flow.It realizes from network state, flow and time triple dimensions, is effectively saved flow, simultaneously Save electricity.
3rd embodiment
Referring to Fig. 4, an embodiment of the present invention provides a kind of background traffic control device 400, the background traffic control Device 400 includes:Detection unit 410, flow acquiring unit 420, the first judging unit 430, time acquisition unit 440, second Judging unit 450 and first forbids unit 460.
Detection unit 410, for when application program initiates network request, detecting whether the application program currently runs On backstage.
As an implementation, the detection unit 410 may include detection sub-unit 411.
Detection sub-unit 411, for being currently to detect the application program by matching pre-set status indicator It is no to operate in backstage.
Flow acquiring unit 420, for when the detection unit 410 is detected as being, obtaining the application program rear The flow value received and dispatched under mesa-shaped state.First judging unit 430, for judging whether the flow value is more than preset flow threshold Value.
The flow value includes:The application program is obtained under background state, the application program transmission data is disappeared The flow that the flow and reception data of consumption are consumed.
As an implementation, the first judging unit 430 may include second forbidding subelement 431.
Second forbids subelement 431, if when for being more than preset flow threshold value, forbids the network request.
Time acquisition unit 440, for when first judging unit is judged as NO, obtaining the application program rear The time span run under mesa-shaped state.
Second judgment unit 450, for judging whether the time span is more than preset time threshold.
First forbids unit 460, for when the second judgment unit is judged as NO, forbidding the network request.With Upper each unit can be by software code realization, at this point, above-mentioned each unit can be stored in memory 110.The above each unit It can equally be realized by hardware such as IC chip.
The technique effect of background traffic control device 400 provided in an embodiment of the present invention, realization principle and generation is with before It is identical to state method first embodiment, to briefly describe, device embodiment part does not refer to place, and it is real to can refer to preceding method first Apply corresponding contents in example.
Fourth embodiment
Referring to Fig. 5, an embodiment of the present invention provides a kind of background traffic control device 500, the background traffic control Device 500 includes:Detection unit 510, network acquiring unit 520, flow acquiring unit 530, the first judging unit 540, time Acquiring unit 550, second judgment unit 560 and first forbid unit 570.
Detection unit 510, for when application program initiates network request, detecting whether the application program currently runs On backstage.
As an implementation, the detection unit 510 may include detection sub-unit 511.
Detection sub-unit 511, for being currently to detect the application program by matching pre-set status indicator It is no to operate in backstage.
Network acquiring unit 520, for when the detection unit 510 is detected as being, obtaining the application program place User terminal network state information.
Flow acquiring unit 520, the flow value received and dispatched under background state for obtaining the application program.First Judging unit 530, for judging whether the flow value is more than preset flow threshold value.
The flow value includes:The application program is obtained under background state, the application program transmission data is disappeared The flow that the flow and reception data of consumption are consumed.
As an implementation, the first judging unit 540 may include that the first judgment sub-unit 541 and second forbid son Unit 542.
First judgment sub-unit 541, for judging whether the flow value is more than that the network state information is corresponding pre- If flow threshold.
Second forbids subelement 542, if be judged as NO for first judging unit 540, the network is forbidden to ask It asks.
Time acquisition unit 550, for when first judging unit 540 is judged as NO, obtaining the application program The time span run under background state.
Second judgment unit 560, for judging whether the time span is more than preset time threshold.
As an implementation, the second judgment unit 560 may include the second judgment sub-unit 561.
Second judgment sub-unit 561, for judging whether the time span is more than that the network state information is corresponding Preset time threshold.
First forbids unit 570, for when the second judgment unit is judged as NO, forbidding the network request.
The above each unit can be by software code realization, at this point, above-mentioned each unit can be stored in memory 110. The above each unit can equally be realized by hardware such as IC chip.
The technique effect of background traffic control device 500 provided in an embodiment of the present invention, realization principle and generation is with before It is identical to state method second embodiment, to briefly describe, device embodiment part does not refer to place, and it is real to can refer to preceding method second Apply corresponding contents in example.
In several embodiments provided herein, it should be understood that disclosed device and method can also pass through Other modes are realized.The apparatus embodiments described above are merely exemplary, for example, the flow chart in attached drawing and block diagram Show the device of multiple embodiments according to the present invention, the architectural framework in the cards of method and computer program product, Function and operation.In this regard, each box in flowchart or block diagram can represent the one of a module, section or code Part, a part for the module, section or code, which includes that one or more is for implementing the specified logical function, to be held Row instruction.It should also be noted that at some as in the realization method replaced, the function of being marked in box can also be to be different from The sequence marked in attached drawing occurs.For example, two continuous boxes can essentially be basically executed in parallel, they are sometimes It can execute in the opposite order, this is depended on the functions involved.It is also noted that every in block diagram and or flow chart The combination of box in a box and block diagram and or flow chart can use function or the dedicated base of action as defined in executing It realizes, or can be realized using a combination of dedicated hardware and computer instructions in the system of hardware.
In addition, each function module in each embodiment of the present invention can integrate to form an independent portion Point, can also be modules individualism, can also two or more modules be integrated to form an independent part.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module It is stored in a computer read/write memory medium.Based on this understanding, technical scheme of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be expressed in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic disc or CD.It needs Illustrate, herein, relational terms such as first and second and the like be used merely to by an entity or operation with Another entity or operation distinguish, and without necessarily requiring or implying between these entities or operation, there are any this realities The relationship or sequence on border.Moreover, the terms "include", "comprise" or its any other variant are intended to the packet of nonexcludability Contain, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes Other elements that are not explicitly listed, or further include for elements inherent to such a process, method, article, or device. In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including the element Process, method, article or equipment in there is also other identical elements.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, any made by repair Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.It should be noted that:Similar label and letter exist Similar terms are indicated in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing It is further defined and is explained.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.

Claims (19)

1. a kind of background traffic control method, which is characterized in that the method includes:
When application program initiates network request, detect whether the application program currently operates in backstage;
If the application program is currently operating at backstage, the flow that the application program has been received and dispatched under background state is obtained Value;
Judge whether the flow value is more than preset flow threshold value, if be less than preset flow threshold value, obtains described using journey The time span that sequence has been run under background state judges whether the time span is more than preset time threshold, if being more than The preset time threshold forbids the network request.
2. according to the method described in claim 1, it is characterized in that, obtaining the application program under background state described Before flow value through transmitting-receiving, the method further includes:
Obtain the network state information of the user terminal where the application program.
3. according to the method described in claim 2, it is characterized in that, described judge whether the flow value is more than preset flow threshold Value, including:
Judge whether the flow value is more than the corresponding preset flow threshold value of the network state information.
4. according to the method described in claim 2, it is characterized in that, described judge whether the time span is more than preset time Threshold value, including:
Judge whether the time span is more than the corresponding preset time threshold of the network state information.
5. according to the method described in claim 2, it is characterized in that, the network state information includes the user terminal is based on 2G network formats carry out network communication, the user terminal is based on 3G network standard and carries out network communication, the user terminal base Network communication, the user terminal are carried out based on a kind of network in the progress network communication of Wifi network formats in 4G network formats Communication mode.
6. according to the method described in claim 5, it is characterized in that, the corresponding preset flow threshold value of the 2G network formats is 100kb, the corresponding preset flow threshold value of the 3G network standard are 500kb, the corresponding preset flow threshold of the 4G network formats Value is 1M, and the corresponding preset flow threshold value of the Wifi network formats is infinity.
7. according to the method described in claim 5, it is characterized in that, the corresponding preset time threshold of the 2G network formats is 2 Minute, the corresponding preset time threshold of the 3G network standard is 1 minute, the corresponding preset time threshold of the 4G network formats It it is 30 seconds, the corresponding preset time threshold of the Wifi network formats is infinity.
8. according to the method described in claim 1, it is characterized in that, after whether the detection application program currently operate in Platform, including:
Detect whether the application program currently operates in backstage by matching pre-set status indicator.
9. according to the method described in claim 1, it is characterized in that, the flow value includes:
The application program is obtained under background state, the flow and receive data that the application program transmission data is consumed The flow consumed.
10. according to the method described in claim 1, it is characterized in that, described judge whether the flow value is more than preset flow Threshold value further includes:
If when more than preset flow threshold value, forbid the network request.
11. a kind of background traffic control device, which is characterized in that the background traffic control device includes:
Detection unit, for when application program initiates network request, detecting whether the application program currently operates in backstage;
Flow acquiring unit, for when the detection unit is detected as being, obtaining the application program under background state Flow value through transmitting-receiving;
First judging unit, for judging whether the flow value is more than preset flow threshold value;
Time acquisition unit, for when first judging unit is judged as NO, obtaining the application program in background state Under the time span that has run;
Second judgment unit, for judging whether the time span is more than preset time threshold;
First forbids unit, for when the second judgment unit is judged as NO, forbidding the network request.
12. background traffic control device according to claim 11, which is characterized in that the background traffic control device is also Including:
Network acquiring unit, for when the detection unit is detected as being, obtaining the user terminal where the application program Network state information.
13. background traffic control device according to claim 12, which is characterized in that first judging unit includes:
First judgment sub-unit, for judging whether the flow value is more than the corresponding preset flow threshold of the network state information Value.
14. background traffic control device according to claim 12, which is characterized in that the second judgment unit includes:
Second judgment sub-unit, for judging whether the time span is more than the corresponding preset time of the network state information Threshold value.
15. background traffic control device according to claim 11, which is characterized in that the detection unit includes:
Detection sub-unit, for detecting whether the application program currently operates in by matching pre-set status indicator From the background.
16. background traffic control device according to claim 11, which is characterized in that the flow value includes:
The application program is obtained under background state, the flow and receive data that the application program transmission data is consumed The flow consumed.
17. background traffic control device according to claim 11, which is characterized in that first judging unit also wraps It includes:
Second forbids subelement, if be judged as NO for first judging unit, forbids the network request.
18. a kind of user terminal, which is characterized in that the user terminal includes processor and memory, the processor and institute Memory is stated to be electrically connected by bus;The memory is for storing program;The processor, for being called by the bus The program being stored in the memory executes:
When application program initiates network request, detect whether the application program currently operates in backstage;
If the application program is currently operating at backstage, the flow that the application program has been received and dispatched under background state is obtained Value;
Judge whether the flow value is more than preset flow threshold value, if be less than preset flow threshold value, obtains described using journey The time span that sequence has been run under background state judges whether the time span is more than preset time threshold, if being more than The preset time threshold forbids the network request.
19. a kind of storage medium, which is characterized in that the storage medium is stored with the executable program code of processor, described Program code is configured to that the processor is made to execute such as any one of claim 1-10 the method.
CN201710539970.2A 2017-07-03 2017-07-03 Background traffic control method, device, storage medium and user terminal Pending CN108282410A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710539970.2A CN108282410A (en) 2017-07-03 2017-07-03 Background traffic control method, device, storage medium and user terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710539970.2A CN108282410A (en) 2017-07-03 2017-07-03 Background traffic control method, device, storage medium and user terminal

Publications (1)

Publication Number Publication Date
CN108282410A true CN108282410A (en) 2018-07-13

Family

ID=62801217

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710539970.2A Pending CN108282410A (en) 2017-07-03 2017-07-03 Background traffic control method, device, storage medium and user terminal

Country Status (1)

Country Link
CN (1) CN108282410A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109656718A (en) * 2018-12-20 2019-04-19 四川长虹电器股份有限公司 Smart television application control method
CN110290070A (en) * 2019-05-15 2019-09-27 北京三快在线科技有限公司 A kind of flow control methods, device, equipment and readable storage medium storing program for executing
CN110725989A (en) * 2018-07-17 2020-01-24 新智数字科技有限公司 Method and device for controlling valve, storage medium and electronic device
CN113656240A (en) * 2021-07-08 2021-11-16 上海二三四五网络科技有限公司 Control method and control device for judging activation state of app application program
CN114268690A (en) * 2021-12-17 2022-04-01 中国电信股份有限公司 Application program control method and device, electronic equipment and storage medium
CN114338533A (en) * 2021-12-30 2022-04-12 广东明创软件科技有限公司 Adjusting method, electronic equipment and computer storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516502A (en) * 2015-12-16 2016-04-20 惠州Tcl移动通信有限公司 Mobile terminal and flow control method therefor
CN105607979A (en) * 2015-12-18 2016-05-25 小米科技有限责任公司 Network interconnection control method and device
CN105704758A (en) * 2016-01-05 2016-06-22 广东欧珀移动通信有限公司 Method and device of closing social applications based on flow monitoring
CN106547615A (en) * 2016-11-25 2017-03-29 珠海市魅族科技有限公司 A kind of management method and management module of background application

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516502A (en) * 2015-12-16 2016-04-20 惠州Tcl移动通信有限公司 Mobile terminal and flow control method therefor
CN105607979A (en) * 2015-12-18 2016-05-25 小米科技有限责任公司 Network interconnection control method and device
CN105704758A (en) * 2016-01-05 2016-06-22 广东欧珀移动通信有限公司 Method and device of closing social applications based on flow monitoring
CN106547615A (en) * 2016-11-25 2017-03-29 珠海市魅族科技有限公司 A kind of management method and management module of background application

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110725989A (en) * 2018-07-17 2020-01-24 新智数字科技有限公司 Method and device for controlling valve, storage medium and electronic device
CN109656718A (en) * 2018-12-20 2019-04-19 四川长虹电器股份有限公司 Smart television application control method
CN110290070A (en) * 2019-05-15 2019-09-27 北京三快在线科技有限公司 A kind of flow control methods, device, equipment and readable storage medium storing program for executing
CN113656240A (en) * 2021-07-08 2021-11-16 上海二三四五网络科技有限公司 Control method and control device for judging activation state of app application program
CN114268690A (en) * 2021-12-17 2022-04-01 中国电信股份有限公司 Application program control method and device, electronic equipment and storage medium
CN114338533A (en) * 2021-12-30 2022-04-12 广东明创软件科技有限公司 Adjusting method, electronic equipment and computer storage medium

Similar Documents

Publication Publication Date Title
CN108282410A (en) Background traffic control method, device, storage medium and user terminal
WO2019119985A1 (en) Method for preloading application, storage medium, and terminal device
US11164097B2 (en) Method for preloading application, storage medium, and terminal device
CN107181858B (en) Method and terminal for displaying notification message
CN108874289B (en) Application history record viewing method and device and electronic equipment
CN106951057B (en) Application control method and mobile terminal
US20160357616A1 (en) Application management method and application management apparatus
CN107484190B (en) Method for connecting network, mobile terminal and computer readable storage medium
CN107145386B (en) Data migration method, terminal device and computer readable storage medium
CN112181220A (en) Icon display method, equipment and system
CN106937258B (en) A kind of control method of broadcast, device and mobile terminal
CN104601683A (en) File download management method, mobile terminal and communication system
CN110989877B (en) Message management method, related equipment and computer readable storage medium
WO2021098239A1 (en) Mini-program switching method and apparatus, framework, device and readable medium
CN111046290A (en) Advertisement processing method and device, electronic equipment and storage medium
CN111142650B (en) Screen brightness adjusting method, screen brightness adjusting device and terminal
WO2019062341A1 (en) Background application cleaning method and apparatus, and storage medium and electronic device
CN111857466B (en) Message display method and device
CN108366298A (en) Video broadcasting method, mobile terminal and computer readable storage medium
CN110515662B (en) Remote control method, system, equipment and readable storage medium for dual-system equipment
CN112929254A (en) Message processing method and device and electronic equipment
CN108536512B (en) Interface switching method and device and terminal equipment
CN107870811B (en) Application cleaning method and device, storage medium and electronic equipment
CN109799715B (en) Data receiving method, device and terminal equipment
CN107995645A (en) Method for connecting network, mobile terminal and computer-readable recording medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20200622

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

Address before: 510000 Guangdong city of Guangzhou province Whampoa Tianhe District Road No. 163 Xiping Yun Lu Yun Ping B radio square 14 storey tower

Applicant before: GUANGZHOU UCWEB COMPUTER TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20180713

RJ01 Rejection of invention patent application after publication