CN104484259A - Application program traffic monitoring method and device, and mobile terminal - Google Patents
Application program traffic monitoring method and device, and mobile terminal Download PDFInfo
- Publication number
- CN104484259A CN104484259A CN201410690841.XA CN201410690841A CN104484259A CN 104484259 A CN104484259 A CN 104484259A CN 201410690841 A CN201410690841 A CN 201410690841A CN 104484259 A CN104484259 A CN 104484259A
- Authority
- CN
- China
- Prior art keywords
- traffic
- application program
- links
- detected application
- mobile terminal
- 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
Links
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
Description
技术领域technical field
本发明涉及互联网技术,尤其涉及一种应用程序的流量监控方法、装置和移动终端。The present invention relates to Internet technology, in particular to a flow monitoring method, device and mobile terminal of an application program.
背景技术Background technique
如今大部分的移动终端都具有上网功能,尤其是随着智能手机的普及,将人们带入了网络时代,而移动终端一般都安装有的大量的应用程序,通过应用程序访问网络来获取信息,同时会消耗该移动终端的数据流量。Nowadays, most of the mobile terminals have the function of surfing the Internet, especially with the popularity of smart phones, people have been brought into the Internet era, and mobile terminals are generally installed with a large number of applications, and access to the network through applications to obtain information, At the same time, the data traffic of the mobile terminal will be consumed.
在实际应用中,一些不法分子开发恶意的应用程序,即使用户未使用该应用程序,该应用程序仍然会在后台运行,使移动终端的流量消耗大大增加,这不仅快速消耗用户移动设备的电量,还有可能给用户增加一大笔额外的流量费用。In practical applications, some criminals develop malicious applications. Even if the user does not use the application, the application will still run in the background, which greatly increases the traffic consumption of the mobile terminal, which not only quickly consumes the power of the user's mobile device, It is also possible to add a large amount of additional traffic charges to users.
现有技术中,使用一般的流量监控软件只能监控移动终端所消耗的总的数据流量,无法对各个应用程序的流量分别进行统计,因此存在流量监控的精确性较低的问题。In the prior art, the general traffic monitoring software can only monitor the total data traffic consumed by the mobile terminal, but cannot separately count the traffic of each application program, so there is a problem of low accuracy of traffic monitoring.
发明内容Contents of the invention
为此,本发明实施例提供一种应用程序的流量监控方法、装置和移动终端,用以精确监控应用程序的流量。To this end, the embodiments of the present invention provide a method, device and mobile terminal for monitoring the flow of application programs, so as to accurately monitor the flow of application programs.
本发明实施例采用如下技术方案:The embodiment of the present invention adopts following technical scheme:
第一方面,提供一种应用程序的流量监控方法,包括:In the first aspect, a flow monitoring method of an application program is provided, including:
根据被检测的应用程序的标识,确定所述被检测的应用程序发起的所有链接;determining all links initiated by the detected application according to the identifier of the detected application;
统计所述被检测的应用程序发起的所有链接所使用的流量,将所述统计的流量作为所述被检测的应用程序的流量。The traffic used by all the links initiated by the detected application is counted, and the counted traffic is used as the traffic of the detected application.
结合第一方面,在第一种可能的实现方式中,所述识别所述所有链接中的有效链接包括:With reference to the first aspect, in a first possible implementation manner, the identifying valid links in all the links includes:
解析所述所有链接对应的URI,获取所述所有链接对应的主机域名;Analyzing the URIs corresponding to all the links, and obtaining the host domain names corresponding to all the links;
判断所述所有链接对应的主机域名是否存在于预设host黑名单中,并判定存在于所述预设host黑名单中的主机域名对应的链接为无效链接,不存在于所述预设host黑名单中的主机域名对应的链接为有效链接。Judging whether the host domain names corresponding to all the links exist in the preset host blacklist, and determining that the links corresponding to the host domain names existing in the preset host blacklist are invalid links and do not exist in the preset host blacklist The links corresponding to the host domain names in the list are valid links.
结合第一种可能的实现方式,在第二可能的实现方式中,所述应用程序的流量监控方法还包括:确定所述无效链接对应的消耗流量,将所述消耗流量作为对应的节省流量。With reference to the first possible implementation manner, in a second possible implementation manner, the application traffic monitoring method further includes: determining the consumed traffic corresponding to the invalid link, and using the consumed traffic as the corresponding saved traffic.
结合第一方面,在第三种可能的实现方式中,所述将所述统计的流量作为所述被检测的应用程序的流量之后,包括:With reference to the first aspect, in a third possible implementation manner, after using the counted traffic as the traffic of the detected application program, it includes:
通过安装所述被检测的应用程序的移动终端的用户界面展示所述被检测的应用程序的流量。The traffic of the detected application is displayed through the user interface of the mobile terminal installed with the detected application.
结合第一方面,在第四种可能的实现方式中,所述将所述统计的流量作为所述被检测的应用程序的流量之后,包括:With reference to the first aspect, in a fourth possible implementation manner, after using the counted traffic as the traffic of the detected application program, it includes:
将所述被检测的应用程序的流量与预设的所述被检测的应用程序的流量阈值进行比较,若所述被检测的应用程序的流量大于等于所述被检测的应用程序的流量阈值时,通过所述移动终端的用户界面进行流量预警提示。comparing the traffic of the detected application with a preset traffic threshold of the detected application, if the traffic of the detected application is greater than or equal to the traffic threshold of the detected application , performing a traffic warning prompt through the user interface of the mobile terminal.
结合第四种可能的实现方式,在第五种可能的实现方式中,所述通过所述移动终端的用户界面进行流量预警提示之后,包括:With reference to the fourth possible implementation manner, in the fifth possible implementation manner, after performing the traffic warning prompt through the user interface of the mobile terminal, it includes:
接收所述移动终端发送的用户操作信息,所述用户操作信息为用户通过所述移动终端的用户界面对所述被检测的应用程序所做操作的信息,包括关闭或禁止所述应用程序的操作信息,或者包括将所述被检测的应用程序加入流量黑名单的操作信息;receiving user operation information sent by the mobile terminal, where the user operation information is information on operations performed by the user on the detected application program through the user interface of the mobile terminal, including closing or prohibiting the operation of the application program information, or include operational information for adding the detected application to a traffic blacklist;
根据所述用户操作信息进行相关的操作,包括关闭所述被检测的应用程序,或禁止所述应用程序进行网络链接,或者将所述被检测的应用程序的标识保存到所述流量黑名单中。Perform relevant operations according to the user operation information, including closing the detected application program, or prohibiting the application program from connecting to the network, or saving the identification of the detected application program in the traffic blacklist .
第二方面,提供一种应用程序的流量监控装置,包括:In the second aspect, an application traffic monitoring device is provided, including:
确定单元,用于根据被检测的应用程序的标识,确定所述被检测的应用程序发起的所有链接;A determining unit, configured to determine all links initiated by the detected application program according to the identifier of the detected application program;
统计单元,用于统计所述被检测的应用程序发起的所有链接所使用的流量,将所述统计的流量作为所述被检测的应用程序的流量。The statistical unit is configured to count the traffic used by all the links initiated by the detected application, and use the counted traffic as the traffic of the detected application.
结合第二方面,在第一种可能的实现方式,所述统计单元包括:With reference to the second aspect, in a first possible implementation manner, the statistical unit includes:
解析子单元,用于解析所述所有链接对应的URI,获取所述所有链接对应的主机域名;The parsing subunit is configured to parse the URIs corresponding to all the links, and obtain the host domain names corresponding to all the links;
判断子单元,用于判断所述所有链接对应的主机域名是否存在于预设host黑名单中,并判定存在于所述预设host黑名单中的主机域名对应的链接为无效链接,不存在于所述预设host黑名单中的主机域名对应的链接为有效链接。The judging subunit is used to judge whether the host domain names corresponding to all the links exist in the preset host blacklist, and determine that the links corresponding to the host domain names in the preset host blacklist are invalid links and do not exist in the default host blacklist. Links corresponding to host domain names in the preset host blacklist are valid links.
结合第一种可能的实现方式,在第二可能的实现方式中,所述装置还包括节省单元:用于确定所述无效链接对应的消耗流量,将所述消耗流量作为对应的节省流量。With reference to the first possible implementation manner, in a second possible implementation manner, the apparatus further includes a saving unit configured to determine the consumption flow corresponding to the invalid link, and use the consumption flow as the corresponding saving flow.
结合第二方面,在第三种可能的实现方式中,所述装置还包括:With reference to the second aspect, in a third possible implementation manner, the device further includes:
展示单元,用于通过安装所述被检测的应用程序的移动终端的用户界面展示所述被检测的应用程序的流量。The display unit is configured to display the traffic of the detected application program through the user interface of the mobile terminal installed with the detected application program.
结合第二方面,在第四种可能的实现方式中,所述装置还包括:With reference to the second aspect, in a fourth possible implementation manner, the device further includes:
判断单元,用于将所述被检测的应用程序的流量与预设的所述被检测的应用程序的流量阈值进行比较,若所述被检测的应用程序的流量大于等于所述被检测的应用程序的流量阈值时,通过所述移动终端的用户界面进行流量预警提示。a judging unit, configured to compare the traffic of the detected application with a preset traffic threshold of the detected application, and if the traffic of the detected application is greater than or equal to the traffic of the detected application When the flow threshold of the program is reached, the user interface of the mobile terminal is used to provide a flow warning prompt.
结合第四种可能的实现方式,在第五种可能的实现方式中,所述判断单元包括:With reference to the fourth possible implementation manner, in a fifth possible implementation manner, the judging unit includes:
接收子单元,用于接收所述移动终端发送的用户操作信息,所述用户操作信息为用户通过所述移动终端的用户界面对所述被检测的应用程序所做操作的信息,包括关闭或禁止所述应用程序的操作信息,或者包括将所述被检测的应用程序加入流量黑名单的操作信息;The receiving subunit is configured to receive user operation information sent by the mobile terminal, the user operation information is information about the operation performed by the user on the detected application program through the user interface of the mobile terminal, including closing or prohibiting The operation information of the application program, or include the operation information of adding the detected application program to the traffic blacklist;
操作子单元,用于根据所述用户操作信息进行相关的操作,包括关闭所述被检测的应用程序,或禁止所述应用程序进行网络链接,或者将所述被检测的应用程序的标识保存到所述流量黑名单中。An operation subunit, configured to perform related operations according to the user operation information, including closing the detected application program, or prohibiting the application program from connecting to the network, or saving the identification of the detected application program in the In the traffic blacklist.
第三方面,提供一种移动终端,包括:上述第二方面或第二方面的第一至第五种任一种可能实现方式所述的应用程序的流量监控装置。In a third aspect, a mobile terminal is provided, including: the apparatus for monitoring traffic of an application program described in the second aspect or any one of the first to fifth possible implementation manners of the second aspect.
区别于现有技术,上述技术方案通过确定所述被检测的应用程序发起的所有链接,能够统计所述被检测的应用程序发起的所有链接所使用的流量,将所述统计的流量作为所述被检测的应用程序的流量,从而实现对各应用程序流量的精确、有效、全面的监控。Different from the prior art, the above technical solution can count the traffic used by all the links initiated by the detected application by determining all the links initiated by the detected application, and use the counted traffic as the The flow of the detected application program, so as to realize the accurate, effective and comprehensive monitoring of the flow of each application program.
附图说明Description of drawings
图1为本发明实施例一应用程序的流量监控方法的流程示意图;图2为本发明实施例二应用程序的流量监控方法的流程示意图;FIG. 1 is a schematic flowchart of a method for monitoring traffic of an application program in Embodiment 1 of the present invention; FIG. 2 is a schematic flowchart of a method for monitoring traffic of an application program in Embodiment 2 of the present invention;
图3a为本发明一实施例移动终端提供的用户界面展示流量的示意图;FIG. 3a is a schematic diagram of a user interface display flow provided by a mobile terminal according to an embodiment of the present invention;
图3b为本发明一实施例移动终端提供的用户界面展示拦截后台运行的应用程序的示意图之一;Fig. 3b is one of the schematic diagrams of the user interface provided by the mobile terminal according to an embodiment of the present invention to display and intercept the application program running in the background;
图3c为本发明一实施例移动终端提供的用户界面展示拦截后台运行的应用程序的示意图之二;Fig. 3c is the second schematic diagram of the user interface provided by the mobile terminal according to an embodiment of the present invention to display and intercept the application program running in the background;
图3d为本发明一实施例移动终端提供的用户界面展示拦截后台运行的应用程序的示意图之三;Fig. 3d is the third schematic diagram of the user interface provided by the mobile terminal according to an embodiment of the present invention to display and intercept the application program running in the background;
图4为本发明实施例三应用程序的流量监控方法的流程示意图;FIG. 4 is a schematic flowchart of a traffic monitoring method for an application program in Embodiment 3 of the present invention;
图5为本发明实施例三应用程序的流量监控方法的部分流程示意图;FIG. 5 is a schematic flow diagram of a part of the traffic monitoring method of an application program in Embodiment 3 of the present invention;
图6为本发明实施例四应用程序的流量监控装置的模块示意图;FIG. 6 is a block diagram of a flow monitoring device of an application program according to Embodiment 4 of the present invention;
图7为本发明实施例四应用程序的流量监控装置的另一模块示意图;FIG. 7 is a schematic diagram of another module of the flow monitoring device of the fourth application program of the present invention;
图8为本发明实施例四判断单元的模块示意图;FIG. 8 is a block diagram of a judgment unit in Embodiment 4 of the present invention;
图9为本发明实施例五所适用的一流量监控系统的系统示意图;9 is a schematic diagram of a flow monitoring system applicable to Embodiment 5 of the present invention;
图10为本发明实施例所适用的另一流量监控系统的系统示意图。Fig. 10 is a system schematic diagram of another flow monitoring system applicable to the embodiment of the present invention.
具体实施方式Detailed ways
为详细说明技术方案的技术内容、构造特征、所实现目的及效果,以下结合具体实施例并配合附图详予说明。In order to explain in detail the technical content, structural features, achieved goals and effects of the technical solution, the following will be described in detail in conjunction with specific embodiments and accompanying drawings.
本发明实施例可以应用于计算机系统/服务器,其可与众多其它通用或专用计算系统环境或配置一起操作。适于与计算机系统/服务器一起使用的众所周知的计算系统、环境和/或配置的例子包括但不限于:个人计算机系统、服务器计算机系统、瘦客户机、厚客户机、手持或膝上设备、基于微处理器的系统、机顶盒、可编程消费电子产品、网络个人电脑、小型计算机系统﹑大型计算机系统和包括上述任何系统的分布式云计算技术环境,等等。Embodiments of the invention may be applied to computer systems/servers that are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well-known computing systems, environments and/or configurations suitable for use with computer systems/servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, Microprocessor-based systems, set-top boxes, programmable consumer electronics, networked personal computers, minicomputer systems, mainframe computer systems, and distributed cloud computing technology environments including any of the above, etc.
计算机系统/服务器可以在由计算机系统执行的计算机系统可执行指令(诸如程序模块)的一般语境下描述。通常,程序模块可以包括例程、程序、目标程序、组件、逻辑、数据结构等等,它们执行特定的任务或者实现特定的抽象数据类型。计算机系统/服务器可以在分布式云计算环境中实施,分布式云计算环境中,任务是由通过通信网络链接的远程处理设备执行的。在分布式云计算环境中,程序模块可以位于包括存储设备的本地或远程计算系统存储介质上。Computer systems/servers may be described in the general context of computer system-executable instructions, such as program modules, being executed by the computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc., that perform particular tasks or implement particular abstract data types. The computer system/server can be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computing system storage media including storage devices.
本发明实施例中,客户端的操作系统为了便于使用VPN(虚拟专用网络,Virtual Private Network)服务,开放了多个系统接口(API),在得到用户确认的情况下,VPN服务能够获得控制和管理其它应用的权限。本发明实施例通过调用操作系统提供的API,将客户端内部的VPN服务打开,当客户端的其它应用要访问网络时,应用所发起的网络连接请求均经过本地VPN服务的处理,使得客户端能够有效且安全地访问网络资源。In the embodiment of the present invention, in order to facilitate the use of VPN (Virtual Private Network, Virtual Private Network) services, the operating system of the client opens a plurality of system interfaces (APIs), and the VPN service can be controlled and managed with the confirmation of the user. Permissions for other apps. The embodiment of the present invention opens the VPN service inside the client by calling the API provided by the operating system. When other applications on the client want to access the network, all network connection requests initiated by the application are processed by the local VPN service, so that the client can Efficient and secure access to network resources.
客户端在安装或首次启动用于实现本发明方案的独立的应用(以下称为本发明应用)时,本发明应用需要创建本地VPN服务,此时本发明应用向用户发出信任或不信任本应用的提示信息,如果用户选择信任,则本发明应用创建本地VPN服务。在创建本地VPN服务之后,由于在操作系统框架内允许VPN框架里的应用对其它应用具有更高的控制权,所以本发明应用对于网络连接的控制级别高于其它应用。在用户要使用某些应用且希望在使用这些应用的过程中对这些应用发起的网络连接进行处理时,启动上述创建本地VPN服务的本发明应用,点击本发明应用的设置开关用于启动VPN client。在启动VPN client后,执行本实施例提供的方法。When the client installs or starts the independent application (hereinafter referred to as the application of the present invention) for realizing the solution of the present invention for the first time, the application of the present invention needs to create a local VPN service. At this time, the application of the present invention sends a trust or distrust to the user. If the user chooses to trust the prompt information, the application of the present invention creates a local VPN service. After the local VPN service is created, because the applications in the VPN framework are allowed to have higher control over other applications within the framework of the operating system, the application of the present invention has a higher level of control over network connections than other applications. When the user wants to use some applications and wishes to process the network connections initiated by these applications during the use of these applications, start the above-mentioned application of the present invention for creating local VPN services, click the setting switch of the application of the present invention to start the VPN client . After starting the VPN client, execute the method provided in this embodiment.
实施例一Embodiment one
本发明实施例可以是基于移动终端的VPN的工作原理,此移动终端安装有至少一应用程序,所述至少一应用程序可以被设置为被检测的应用程序;也可以是基于安装在终端的移动终端移动终端移动终端的工作原理,该终端可以是移动终端或手持电子设备,该终端安装有至少一应用程序,所述至少一应用程序可以被设置为被检测的应用程序。The embodiment of the present invention can be based on the working principle of the VPN of the mobile terminal, the mobile terminal is installed with at least one application program, and the at least one application program can be set as the detected application program; it can also be based on the mobile terminal installed on the terminal. Terminal The working principle of the mobile terminal is that the terminal may be a mobile terminal or a handheld electronic device, and the terminal is installed with at least one application program, and the at least one application program may be set as the detected application program.
本发明实施例中,移动终端通过建立的VPN通道将上行压缩数据包发送给计费系统(附图未示出),计费系统统计上行压缩数据包的数据量,将该数据量换算为计费信息记入账单;然后,计费系统将上行压缩数据包转发给VPN服务器。在这里,数据包的传输不是发生在公用网络上,而是发生在虚拟专用网络上,能够避免数据遭到非授权用户的窃取,提高数据传输的安全性。In the embodiment of the present invention, the mobile terminal sends the uplink compressed data packet to the billing system (not shown in the drawings) through the established VPN tunnel, and the billing system counts the data volume of the uplink compressed data packet, and converts the data volume into The fee information is recorded into the bill; then, the billing system forwards the uplink compressed data packet to the VPN server. Here, the transmission of data packets does not occur on the public network, but on the virtual private network, which can prevent data from being stolen by unauthorized users and improve the security of data transmission.
以下了为便于说明,假设本实施例是基于移动终端的工作原理。请参阅图1,示出了本实施例应用程序的流量监控方法的流程示意图,该方法包括:For ease of description, it is assumed that this embodiment is based on the working principle of a mobile terminal. Please refer to FIG. 1, which shows a schematic flow chart of the flow monitoring method of the application program in this embodiment, the method comprising:
S101、根据被检测的应用程序的标识,确定所述被检测的应用程序发起的所有链接;在这里,被检测的应用程序的标识在移动终端的操作系统中是惟一的,且与被检测的应用程序一一对应。应用程序的数据流量以该应用程序的唯一标识符作标记,根据唯一标识符(即前文所说的标识),并通过所述移动终端的流量状态获取接口(android.net.TrafficStats),该接口提供了多种静态方法,可以直接调用获取该应用程序对应的数据流量。S101. Determine all links initiated by the detected application according to the detected application ID; here, the detected application ID is unique in the operating system of the mobile terminal and is identical to the detected Apps correspond one-to-one. The data flow of the application program is marked with the unique identifier of the application program, according to the unique identifier (ie the identification mentioned above), and through the traffic status acquisition interface (android.net.TrafficStats) of the mobile terminal, the interface A variety of static methods are provided, which can be directly called to obtain the data flow corresponding to the application.
在提取数据流量之前,首先获取应用程序的唯一标识符(即前文所说的标识),唯一标识符保存在移动终端,可以通过预先设置的调用函数获取,以Andriod系统为例,通过ActivityManager我们可以获得系统里正在运行的activities,包括进程(Process)等、应用程序/包、服务(Service)、任务(Task)信息,使用ActivityManager的getRunningAppProces(获取正在运行的进程信息)方法获得RunningAppProcessInfo(正在运行的进程信息),在RunningAppProcessInfo里面会有唯一标识符UID。Before extracting the data flow, first obtain the unique identifier of the application (that is, the identifier mentioned above), the unique identifier is stored in the mobile terminal, and can be obtained through the pre-set calling function. Taking the Andriod system as an example, through the ActivityManager we can Get running activities in the system, including process (Process), application program/package, service (Service), task (Task) information, use ActivityManager's getRunningAppProces (get running process information) method to get RunningAppProcessInfo (running Process information), there will be a unique identifier UID in RunningAppProcessInfo.
S102、识别所述所有链接中的有效链接,并统计所述有效链接所使用的流量,将所述统计的流量作为所述被检测的应用程序的流量。S102. Identify valid links among all the links, and count traffic used by the valid links, and use the counted traffic as traffic of the detected application program.
在这里,需要说明的是,与通过进程确定对应应用程序的流量的方式相比,通过应用程序标识确定对应应用程序的流量的方式更为准确。因为当某一应用程序发起链接为无效链接时,此应用程序并没有消耗流量,但终端后台中仍然会存在该链接的进程,那么当通过运行的进程确定对应应用程序的流量则会比实际消耗的流量大,故该方式并不能准确地统计对应应用程序消耗的流量;而且通过进程确定对应应用程序的流量的方式还会将系统中各进程之间的通信流量作为对应应用程序之间的消耗流量,显然这些流量并不是基于运营商产生的流量,而是系统内部组件之间通信的数据量,将这些流量统计为对应应用程序的消耗流量也是不合理、不精确的。而基于应用程序标识确定对应应用程序的流量的方式,则是确定对应应用程序的有效链接,并不会统计无效链接的消耗流量,且并不会统计系统内部组件之间通信的数据量。由上述可知,基于应用程序标识确定对应应用程序的流量的方式更为合理、精确。Here, it should be noted that, compared with the method of determining the traffic of the corresponding application program through the process, the method of determining the traffic corresponding to the application program through the application program identifier is more accurate. Because when an application initiates a link that is an invalid link, the application does not consume traffic, but the process of the link still exists in the background of the terminal, so when the traffic of the corresponding application is determined by the running process, it will be more than the actual consumption. The traffic of the corresponding application is large, so this method cannot accurately count the traffic consumed by the corresponding application; and the method of determining the traffic of the corresponding application through the process will also use the communication traffic between the processes in the system as the consumption between the corresponding applications Traffic, obviously these traffic is not based on the traffic generated by the operator, but the amount of data communicated between internal components of the system, and it is unreasonable and inaccurate to count these traffic as the consumption traffic of the corresponding application. The method of determining the traffic of the corresponding application based on the application identifier is to determine the valid link of the corresponding application, and does not count the consumption traffic of the invalid link, and does not count the amount of data communicated between the internal components of the system. It can be known from the above that the method of determining the traffic of the corresponding application based on the application identifier is more reasonable and accurate.
在这里,所谓有效链接是指当前终端与对端建立了数据链路,并且能够实现双方终端有效的数据通信。Here, the so-called effective link means that the current terminal has established a data link with the opposite end, and can realize effective data communication between the two terminals.
本实施例通过确定所述被检测的应用程序发起的所有有效链接,能够统计所述被检测的应用程序发起的所有有效链接所使用的流量,将所述统计的流量作为所述被检测的应用程序的流量,从而实现对各应用程序流量的精确、有效、全面的监控。In this embodiment, by determining all valid links initiated by the detected application, the traffic used by all valid links initiated by the detected application can be counted, and the counted traffic can be used as the detected application Program traffic, so as to achieve accurate, effective and comprehensive monitoring of the traffic of each application program.
具体的,所述识别所述所有链接中的有效链接可以通过以下方式实现,包括:Specifically, the identification of valid links among all the links may be implemented in the following ways, including:
解析所述所有链接对应的URI,获取所述所有链接对应的主机域名;Analyzing the URIs corresponding to all the links, and obtaining the host domain names corresponding to all the links;
判断所述所有链接对应的主机域名是否存在于预设host黑名单中,并判定存在于所述预设host黑名单中的主机域名对应的链接为无效链接,不存在于所述预设host黑名单中的主机域名对应的链接为有效链接。Judging whether the host domain names corresponding to all the links exist in the preset host blacklist, and determining that the links corresponding to the host domain names existing in the preset host blacklist are invalid links and do not exist in the preset host blacklist The links corresponding to the host domain names in the list are valid links.
在本发明实施例中,host黑名单外,预先还可以设置有黑名单网站列表和白名单网站列表,白名单网站列表中保存有安全的、可信的网站和支付类网站的网址或者网站的其他信息;其中,所述安全的、可信的购物类网站和支付类网站可以是经过了预先认证的网站,可以预先通过监测服务器根据网页的服务器信息:URL、HOST、网络互连协议(Internet Protocol,IP),以及网页所在域名的相关信息:网络内容服务商(Internet ContentProvider,ICP)备案信息(例如,主办单位名称、主办单位性质、经营范围、审核时间等)、WHOIS信息(例如,注册商、域名服务器、相关网站、域名系统服务器、域名状态、更新时间、创建时间、过期时间、域名在其他搜索引擎下的权重和网页收录量等)进行收集,黑名单网站列表中保存有危险的购物类网站和支付类网站的网址或者网站的其他信息,其中,危险的购物类网站和支付类网站例如包括钓鱼网站、恶意链接、挂木马或病毒类的网站,以便于对某一个链接是否有效进行判断。In the embodiment of the present invention, in addition to the host blacklist, a blacklist website list and a whitelist website list can also be set in advance, and the website addresses of safe and credible websites and payment websites or websites are stored in the whitelist website list. Other information; Wherein, described safe, credible shopping class website and payment class website can be the website that has gone through pre-authentication, can pass through monitoring server in advance according to the server information of webpage: URL, HOST, network interconnection protocol (Internet Protocol, IP), and related information about the domain name of the web page: Internet Content Provider (Internet Content Provider, ICP) record information (for example, sponsor name, sponsor nature, business scope, review time, etc.), WHOIS information (for example, registration provider, domain name server, related websites, domain name system server, domain name status, update time, creation time, expiration time, weight of domain name in other search engines and page indexing volume, etc.) URLs of shopping websites and payment websites or other website information, among which, dangerous shopping websites and payment websites include phishing websites, malicious links, websites with Trojan horses or viruses, so as to check whether a certain link is valid judge.
当判定某一链接为无效链接后,则不向所述被检测的应用程序返回所述某一链接对应的请求,从而节约了无效链接的流量。进一步的,本发明实施例还可确定所述无效链接对应的消耗流量,将所述消耗流量作为所述被检测的应用程序对应的节省流量。更进一步的,还可将对应的节省流量显示于移动终端的图形用户界面上,以更形象地形式显示节省流量的具体参数,如图3a所示。本发明实施例还可根据无效链接对应的主机域名(host域名)识别无效链接的来源,以统计此无效链接是基于哪些被检测的应用程序被拦截,以及总共被拦截的次数,例如:可识别某些插件广告或某些非法内容广告为哪家公司的广告,并且可统计这些插件广告基于哪些被检测的应用程序被拦截以及被拦截的次数。When it is determined that a certain link is an invalid link, the request corresponding to the certain link is not returned to the detected application program, thereby saving the traffic of the invalid link. Further, in this embodiment of the present invention, the consumed traffic corresponding to the invalid link may be determined, and the consumed traffic may be used as the saved traffic corresponding to the detected application program. Furthermore, the corresponding saved traffic can also be displayed on the graphical user interface of the mobile terminal, and the specific parameters of saved traffic can be displayed in a more vivid form, as shown in FIG. 3a. The embodiment of the present invention can also identify the source of the invalid link according to the host domain name (host domain name) corresponding to the invalid link, to count which detected application programs are intercepted based on the invalid link, and the total number of intercepted times, for example: identifiable Some plug-in advertisements or some illegal content advertisements are advertisements of which company, and the detected applications based on which these plug-in advertisements are blocked and the number of blocked times can be counted.
具体的,本实施例可通过获取所述无效链接的上行流量,并根据上行流量与下行流量对应的关系确定对应的下行流量,并将此上行流量和下行流量这种作为对应的节省流量。对于流量来说主要分为:Specifically, in this embodiment, the uplink traffic of the invalid link may be acquired, and the corresponding downlink traffic may be determined according to the relationship between the uplink traffic and the downlink traffic, and the uplink traffic and the downlink traffic may be used as the corresponding saving traffic. For flow, it is mainly divided into:
正常消耗的流量:Normal traffic consumption:
用户主动使用该应用期间(从用户打开应用到退出应用),产生的流量。The traffic generated during the period when the user actively uses the application (from the user opening the application to exiting the application).
用户授权的后台下载(例如用户在360手机助手中选择退出后仍然下载应用),消耗的流量。Background download authorized by the user (for example, the user still downloads the application after opting out in the 360 mobile assistant), the traffic consumed.
后台运行期间,为保持正常功能而消耗的少量流量。例如腾讯新闻,会在后台不断联网,当有重大新闻事件时便可及时的通知用户。During background operation, a small amount of traffic is consumed to maintain normal functions. For example, Tencent News will continue to connect to the Internet in the background, and when there are major news events, users can be notified in time.
偷跑的流量:Sneaky traffic:
该应用从本次开机以来,用户从没使用过,消耗的流量为偷跑流量。The app has never been used by the user since it was turned on this time, and the traffic it consumes is stealth traffic.
该应用在用户退出很久后,仍然消耗较多的流量。The app still consumes a lot of traffic long after the user logs out.
应用程序从通信设备启动后,自动加载并连接网络,而用户从没使用过该应用程序,该应用程序消耗的流量;以及,The data consumed by the application, which is automatically loaded and connected to the network after the application is launched from the communication device, and the user has never used the application; and,
用户使用的应用程序在用户选择退出,超过预先设置的下载时间阈值后,且消耗的流量超过预先设置的监测流量阈值的流量。After the user chooses to quit the application program used by the user, after the preset download time threshold is exceeded, and the traffic consumed exceeds the preset monitoring traffic threshold.
进一步的,本实施例还可以减少“偷跑流量”情况的发生。当某些应用程序的升级逻辑做得不合理时,例如当移动终端的网络环境从wifi变为3G/2G、但仍然继续更新某一应用程序A时,或当应用市场自动在后台更新某一应用程序B时,此时移动终端则会将实时统计的流量发送至服务器端进行分析,当服务器端分析出应用程序A由于网络环境变化造成流量过大或应用程序B由于自动在后台更新造成流量过大时,则会向移动终端发送相应的拦截建议,例如对于应用程序A,则会发出“网络环境从wifi变为移动数据网络,继续更新会造成大量花费”的提示信息显示在移动终端的显示屏上;对于应用程序B,则会向移动终端发送拦截指示,移动接收到此拦截指示后直接将应用程序B的更新过程关闭。另外,还可通过本实施例提供的技术方案可以统计、显示出相应应用程序的流量消耗情况。Furthermore, this embodiment can also reduce the occurrence of "stealing traffic". When the upgrade logic of some applications is unreasonable, for example, when the network environment of the mobile terminal changes from wifi to 3G/2G, but still continues to update a certain application A, or when the application market automatically updates a certain application in the background For application B, the mobile terminal will send the real-time statistical traffic to the server for analysis. When the server analyzes that the traffic of application A is too large due to changes in the network environment or the traffic of application B is automatically updated in the background When it is too large, it will send corresponding interception suggestions to the mobile terminal. For example, for application A, it will issue a prompt message "The network environment has changed from wifi to mobile data network, continuing to update will cause a lot of cost" and displayed on the mobile terminal. For the application program B, an interception instruction will be sent to the mobile terminal, and the mobile terminal will directly close the update process of the application program B after receiving the interception instruction. In addition, the technical solution provided by this embodiment can also be used to count and display the traffic consumption of corresponding applications.
具体的,针对某个Android应用程序的记录结果可以是包含安全、危险、谨慎或木马等表示安全级别的信息,此外所述安全检测结果中还可以包括与安全级别相关的行为描述、软件描述、时间戳等至少一项提示信息,如对应“谨慎”级别的提示信息可以是“可能造成扣费,是否选择删除该应用”。Specifically, the record results for a certain Android application program may contain information indicating security levels such as safety, danger, caution, or Trojan horses. In addition, the security detection results may also include behavior descriptions related to security levels, software descriptions, At least one piece of prompt information such as a time stamp, for example, the prompt information corresponding to the level of "cautious" may be "may result in fee deduction, whether to choose to delete the application".
更具体地,在一优选实施例中,所述安全检测结果可以包含安全级别、行为描述信息、软件描述信息和时间戳信息。其中:More specifically, in a preferred embodiment, the security detection result may include security level, behavior description information, software description information and time stamp information. in:
安全级别:可以用32位整数表示,可表示安全、危险、谨慎或木马四个安全级别,每个安全级别的定义如上所述。Security level: It can be represented by a 32-bit integer, which can represent four security levels of security, danger, caution, or Trojan horse. The definition of each security level is as described above.
例如,行为描述信息:可以用32位(0~31)整数表示,可以表示出各个安全级别的软件行为描述。其中,可以选取一位表示标志位,标志位为0表示没有恶意行为,如果有恶意行为,则可以定义:第1位代表“后台偷偷下载”,第2位代表“私自发送短信”,第3位代表“包含广告”,等等。即,每一位都可以单独表示一种软件的行为描述。For example, behavior description information: can be represented by a 32-bit (0-31) integer, and can represent software behavior descriptions of various security levels. Among them, one bit can be selected to indicate the flag bit, and the flag bit is 0 to indicate no malicious behavior. If there is malicious behavior, it can be defined: the first bit represents "secretly downloading in the background", the second bit represents "privately sending SMS", and the third bit represents bit for "contains ads", etc. That is, each bit can independently represent a behavioral description of a software.
对于后台偷偷下载这种情况,认为该程序属于黑名单程序,对于此类程序的联网行为可以考虑中断或者关闭等。当判断任一计算机应用程序的进程的类型为位于黑名单中的黑进程时,可以对该应用程序执行的任何操作在用户界面弹出框中展示信息,提示用户进行处理等。For the case of secretly downloading in the background, the program is considered to be a blacklist program, and the network behavior of such programs can be considered to be interrupted or closed. When it is judged that the process type of any computer application program is a black process in the blacklist, any operation performed on the application program can display information in a pop-up box on the user interface, prompting the user to process and so on.
由于在本发明应用创建本地VPN服务之后,本发明应用对于网络连接的控制级别高于其它应用。在其它应用发出网络连接请求时,本发明应用能拦截网络连接请求,将网络连接请求重定向至本发明应用内的本地服务进程进行后续处理。以应用A为例,当用户启动应用A发起访问应用A内容的网络连接请求时,由于本发明应用对网络连接的控制级别高于应用A,本发明应用拦截该网络连接请求,将网络连接请求重定向至本发明应用内的本地服务进程进行后续处理。After the application of the present invention creates the local VPN service, the application of the present invention has a higher level of control over network connections than other applications. When other applications send a network connection request, the application of the present invention can intercept the network connection request, and redirect the network connection request to the local service process in the application of the present invention for subsequent processing. Taking application A as an example, when the user starts application A to initiate a network connection request to access the content of application A, since the application of the present invention has a higher level of control over the network connection than application A, the application of the present invention intercepts the network connection request and sends the network connection request Redirect to the local service process in the application of the present invention for subsequent processing.
实施例二Embodiment two
本发明实施例中,在其它应用发出网络连接请求时,本发明应用能拦截网络连接请求,将网络连接请求重定向至本发明应用内的本地服务进程进行后续处理。以微博应用为例,当用户启动微博应用发起访问微博内容的网络连接请求时,由于本发明应用对网络连接的控制级别高于微博应用,本发明应用拦截该网络连接请求,将网络连接请求重定向至本发明应用内的本地服务进程进行后续处理。In the embodiment of the present invention, when other applications send a network connection request, the application of the present invention can intercept the network connection request, and redirect the network connection request to the local service process in the application of the present invention for subsequent processing. Taking the microblog application as an example, when the user starts the microblog application to initiate a network connection request to access the content of the microblog, since the application of the present invention has a higher level of control over the network connection than the microblog application, the application of the present invention intercepts the network connection request and will The network connection request is redirected to the local service process in the application of the present invention for subsequent processing.
以下了为便于说明,假设本实施例是基于移动终端的工作原理。在本实施例中,该移动终端还安装有流量监控软件,用以通过移动终端的用户界面展示所述被检测的应用程序的流量。For ease of description, it is assumed that this embodiment is based on the working principle of a mobile terminal. In this embodiment, the mobile terminal is further installed with traffic monitoring software, which is used to display the traffic of the detected application program through the user interface of the mobile terminal.
请参阅图2,示出了本实施例应用程序的流量监控方法的流程示意图,该方法包括:Please refer to FIG. 2, which shows a schematic flow chart of the flow monitoring method of the application program in this embodiment, and the method includes:
S201、根据被检测的应用程序的标识,确定所述被检测的应用程序发起的所有链接;在这里,被检测的应用程序的标识在移动终端的操作系统中是惟一的,且与被检测的应用程序一一对应。应用程序的数据流量以该应用程序的唯一标识符作标记,根据唯一标识符(即前文所说的标识),并通过所述移动终端的流量状态获取接口(android.net.TrafficStats),该接口提供了多种静态方法,可以直接调用获取该应用程序对应的数据流量。S201. Determine all links initiated by the detected application according to the detected application ID; here, the detected application ID is unique in the operating system of the mobile terminal and is identical to the detected Apps correspond one-to-one. The data flow of the application program is marked with the unique identifier of the application program, according to the unique identifier (ie the identification mentioned above), and through the traffic status acquisition interface (android.net.TrafficStats) of the mobile terminal, the interface A variety of static methods are provided, which can be directly called to obtain the data flow corresponding to the application.
在提取数据流量之前,首先获取应用程序的唯一标识符(即前文所说的标识),唯一标识符保存在移动终端,可以通过预先设置的调用函数获取,以Andriod系统为例,通过ActivityManager我们可以获得系统里正在运行的activities,包括进程(Process)等、应用程序/包、服务(Service)、任务(Task)信息,使用ActivityManager的getRunningAppProces(获取正在运行的进程信息)方法获得RunningAppProcessInfo(正在运行的进程信息),在RunningAppProcessInfo里面会有唯一标识符UID。Before extracting the data flow, first obtain the unique identifier of the application (that is, the identifier mentioned above), the unique identifier is stored in the mobile terminal, and can be obtained through the pre-set calling function. Taking the Andriod system as an example, through the ActivityManager we can Get running activities in the system, including process (Process), application program/package, service (Service), task (Task) information, use ActivityManager's getRunningAppProces (get running process information) method to get RunningAppProcessInfo (running Process information), there will be a unique identifier UID in RunningAppProcessInfo.
S202、获取所述所有链接中的有效链接,并统计所述有效链接所使用的流量,将所述统计的流量作为所述被检测的应用程序的流量。S202. Obtain valid links among all the links, and count the traffic used by the valid links, and use the counted traffic as the traffic of the detected application program.
在这里,需要说明的是,与通过进程确定对应应用程序的流量的方式相比,通过应用程序标识确定对应应用程序的流量的方式更为准确。因为当某一应用程序发起链接为无效链接时,此应用程序并没有消耗流量,但终端后台中仍然会存在该链接的进程,那么当通过运行的进程确定对应应用程序的流量则会比实际消耗的流量大,故该方式并不能准确地统计对应应用程序消耗的流量;而且通过进程确定对应应用程序的流量的方式还会将系统中各进程之间的通信流量作为对应应用程序之间的消耗流量,显然这些流量并不是基于运营商产生的流量,而是系统内部组件之间通信的数据量,将这些流量统计为对应应用程序的消耗流量也是不合理、不精确的。而基于应用程序标识确定对应应用程序的流量的方式,则是确定对应应用程序的有效链接,并不会统计无效链接的消耗流量,且并不会统计系统内部组件之间通信的数据量。由上述可知,基于应用程序标识确定对应应用程序的流量的方式更为合理、精确。Here, it should be noted that, compared with the method of determining the traffic of the corresponding application program through the process, the method of determining the traffic corresponding to the application program through the application program identifier is more accurate. Because when an application initiates a link that is an invalid link, the application does not consume traffic, but the process of the link still exists in the background of the terminal, so when the traffic of the corresponding application is determined by the running process, it will be more than the actual consumption. The traffic of the corresponding application is large, so this method cannot accurately count the traffic consumed by the corresponding application; and the method of determining the traffic of the corresponding application through the process will also use the communication traffic between the processes in the system as the consumption between the corresponding applications Traffic, obviously these traffic is not based on the traffic generated by the operator, but the amount of data communicated between internal components of the system, and it is unreasonable and inaccurate to count these traffic as the consumption traffic of the corresponding application. The method of determining the traffic of the corresponding application based on the application identifier is to determine the valid link of the corresponding application, and does not count the consumption traffic of the invalid link, and does not count the amount of data communicated between the internal components of the system. It can be known from the above that the method of determining the traffic of the corresponding application based on the application identifier is more reasonable and accurate.
在这里,所谓有效链接是指当前终端与对端建立了数据链路,并且能够实现双方终端有效的数据通信。具体的,所述识别所述所有链接中的有效链接可以通过以下方式实现,包括:Here, the so-called effective link means that the current terminal has established a data link with the opposite end, and can realize effective data communication between the two terminals. Specifically, the identification of valid links among all the links may be implemented in the following ways, including:
解析所述所有链接对应的URI,获取所述所有链接对应的主机域名;Analyzing the URIs corresponding to all the links, and obtaining the host domain names corresponding to all the links;
判断所述所有链接对应的主机域名是否存在于预设host黑名单中,并判定存在于所述预设host黑名单中的主机域名对应的链接为无效链接,不存在于所述预设host黑名单中的主机域名对应的链接为有效链接。Judging whether the host domain names corresponding to all the links exist in the preset host blacklist, and determining that the links corresponding to the host domain names existing in the preset host blacklist are invalid links and do not exist in the preset host blacklist The links corresponding to the host domain names in the list are valid links.
当判定某一链接为无效链接后,则不向所述被检测的应用程序返回所述某一链接对应的请求,从而节约了无效链接的流量。进一步的,本发明实施例还可确定所述无效链接对应的消耗流量,将所述消耗流量作为所述被检测的应用程序对应的节省流量。更进一步的,还可将对应的节省流量显示于移动终端的图形用户界面上,以更形象地形式显示节省流量的具体参数,如图3a所示。本发明实施例还可根据无效链接对应的主机域名(host域名)识别无效链接的来源,以统计此无效链接是基于哪些被检测的应用程序被拦截,以及总共被拦截的次数,When it is determined that a certain link is an invalid link, the request corresponding to the certain link is not returned to the detected application program, thereby saving the traffic of the invalid link. Further, in this embodiment of the present invention, the consumed traffic corresponding to the invalid link may be determined, and the consumed traffic may be used as the saved traffic corresponding to the detected application program. Furthermore, the corresponding saved traffic can also be displayed on the graphical user interface of the mobile terminal, and the specific parameters of saved traffic can be displayed in a more vivid form, as shown in FIG. 3a. The embodiment of the present invention can also identify the source of the invalid link according to the host domain name (host domain name) corresponding to the invalid link, to count which detected application programs are intercepted based on the invalid link, and the total number of intercepted times,
例如:可识别某些插件广告或某些非法内容广告为哪家公司的广告,并且可统计这些插件广告基于哪些被检测的应用程序被拦截以及被拦截的次数。For example: It can identify which company's advertisements some plug-in advertisements or some illegal content advertisements belong to, and can count the detected applications based on which these plug-in advertisements are blocked and the number of times they are blocked.
具体的,本实施例可通过获取所述无效链接的上行流量,并根据上行流量与下行流量对应的关系确定对应的下行流量,并将此上行流量和下行流量这种作为对应的节省流量。Specifically, in this embodiment, the uplink traffic of the invalid link may be acquired, and the corresponding downlink traffic may be determined according to the relationship between the uplink traffic and the downlink traffic, and the uplink traffic and the downlink traffic may be used as the corresponding saving traffic.
S203、通过移动终端的用户界面展示所述被检测的应用程序的流量。S203. Display the traffic of the detected application program through the user interface of the mobile terminal.
具体的,本实施例可由如图3a所示的用户界面分别展示某天中截止某时刻各应用程序所统计的流量、某天一共使用的流量以及某天共节省的流量,例如在昨天中截止22:54,后台流量使用为482.7k,昨天共使用784.k流量,共节省206.8k流量。Specifically, in this embodiment, the user interface shown in FIG. 3a can respectively display the traffic counted by each application program at a certain time in a certain day, the total traffic used in a certain day, and the total traffic saved in a certain day, for example, as of yesterday At 22:54, the background traffic usage was 482.7k. Yesterday, a total of 784.k traffic was used, saving a total of 206.8k traffic.
点击图3a的“联网防火墙”,则会出现如图3b所示的用户界面,图3b中,移动终端本地服务进程判定并统计出该移动终端具有50款后台运行的应用,并展示并建议“一键优化”功能,用户只要点击“一键优化”按键,则可对这50款后台运行的应用同时进行优化、使之禁止联网。点击“已禁止2/3/4G”和“已禁止后台2/3/4G”,则可看到相应的列表下的应用程序,如图3c所示。在这里,需要说明的是,“已禁止2/3/4G”列表下是被禁止的所有类型的应用程序,包括后台运行及前端运行的应用,而“已禁止后台2/3/4G”列表下则是被禁止的后台运行的应用程序。Click the "Networking Firewall" in Figure 3a, and the user interface shown in Figure 3b will appear. In Figure 3b, the local service process of the mobile terminal determines and counts that the mobile terminal has 50 applications running in the background, and displays and recommends " One-key optimization” function, users only need to click the “one-key optimization” button to optimize these 50 applications running in the background at the same time, so that they are prohibited from connecting to the Internet. Click "2/3/4G Prohibited" and "Background 2/3/4G Prohibited", and you can see the applications under the corresponding list, as shown in Figure 3c. Here, it needs to be explained that under the list of "Background 2/3/4G" are all types of applications that are banned, including applications running in the background and front-end, while the list of "Background 2/3/4G" Below are the apps that are banned from running in the background.
若用户想查看哪些应用程序为后台运行的应用或只想对某些后台运行的应用进行优化时,则可通过图3d所示的界面实施例实现。例如图3d“开心消消乐”“UC浏览器”等应用程序为后台运行的应用时,则会将这些应用程序统计出来并提示“一键优化”,建议用户点击“一键优化”,使统计出来的应用程序禁止联网。移动终端还可直接通过图3d直接进行某些应用程序的选择优化。If the user wants to check which application programs are applications running in the background or only wants to optimize some applications running in the background, it can be realized through the interface embodiment shown in FIG. 3d. For example, in Figure 3d, when applications such as "Happy Xiaoxiaole" and "UC Browser" are running in the background, these applications will be counted out and "one-key optimization" will be prompted. It is recommended that users click "one-key optimization" to enable The counted applications are prohibited from connecting to the Internet. The mobile terminal can also directly perform selection and optimization of certain application programs through Fig. 3d.
后台流量白名单中所记录的应用可以为即时通信应用,例如QQ、微信等,这些在后台流量白名单记录的应用为允许产生后台流量的应用。若判断出第一应用程序不属于后台流量白名单中记录的应用,则发出提示信息用于提示用户选择禁止第一应用程序产生后台流量的网络连接行为。The applications recorded in the background traffic whitelist may be instant messaging applications, such as QQ, WeChat, etc., and these applications recorded in the background traffic whitelist are applications that are allowed to generate background traffic. If it is determined that the first application program does not belong to the application recorded in the background traffic whitelist, then a prompt message is sent to prompt the user to choose to prohibit the network connection behavior of the first application program from generating background traffic.
若判断出第一应用程序属于后台流量白名单中记录的应用,则按照本发明实施例上述的流程,判断第一应用程序产生的后台流量是否超过预设流量阈值。If it is determined that the first application program belongs to the application recorded in the background traffic whitelist, then according to the above-mentioned process of the embodiment of the present invention, it is judged whether the background traffic generated by the first application program exceeds the preset traffic threshold.
本实施例不仅可以实现对各应用程序流量的精确、有效、全面的监控,还可以展示所述被检测的应用程序的流量,以时时向用户展示移动终端各应用程序的流量消耗情况。进一步的,本实施例还可实现流量图绘制功能,用在展示并提醒用户每天所用流量的情况。本实施例还可以实现应用程序的禁止/允许联网功能,当用户发现某一应用程序流量异常时,可通过此功能禁止该应用程序的联网功能,减少无谓流量的消耗。This embodiment can not only realize accurate, effective and comprehensive monitoring of the flow of each application program, but also display the flow of the detected application program, so as to show the user the flow consumption of each application program in the mobile terminal from time to time. Furthermore, this embodiment can also implement a traffic map drawing function, which is used to display and remind the user of the traffic used every day. This embodiment can also realize the function of prohibiting/allowing networking of the application program. When the user finds that the traffic of an application program is abnormal, the networking function of the application program can be prohibited through this function, so as to reduce the consumption of unnecessary traffic.
进一步的,本实施例还可以减少“偷跑流量”情况的发生。例如,应用程序A的名称是否包含在预先定义的数据库中的白名单或黑名单中,并且/或者判断所述恶意应用程序A的信息是否包含预先定义的数据库中的偷跑流量的特征数据。Furthermore, this embodiment can also reduce the occurrence of "stealing traffic". For example, whether the name of application A is included in the whitelist or blacklist in the predefined database, and/or determine whether the information of the malicious application A includes characteristic data of sneak traffic in the predefined database.
当某些应用程序的升级逻辑做得不合理时,例如当移动终端的网络环境从wifi变为3G/2G、但仍然继续更新某一应用程序A时,或当应用市场自动在后台更新某一应用程序B时,此时移动终端则会将实时统计的流量发送至服务器端进行分析,当服务器端分析出应用程序A由于网络环境变化造成流量过大或应用程序B由于自动在后台更新造成流量过大时,则会向移动终端发送相应的拦截建议,例如对于应用程序A,则会发出“网络环境从wifi变为移动数据网络,继续更新会造成大量花费”的提示信息显示在移动终端的显示屏上;对于应用程序B,则会向移动终端发送拦截指示,移动终端接收到此拦截指示后直接将应用程序B的更新过程关闭。另外,还可通过本实施例提供的技术方案可以统计、显示出相应应用程序的流量消耗情况,并通过用户界面展示出来,用户则可通过禁止/允许联网功能来减少“偷跑流量”情况的发生。或者,当本实施例发现上述“偷跑流量”情况的发生时,通过用户界面展示此种情况的报警信息,提醒用户通过禁止/允许联网功能关闭“偷跑流量”的应用程序。When the upgrade logic of some applications is unreasonable, for example, when the network environment of the mobile terminal changes from wifi to 3G/2G, but still continues to update a certain application A, or when the application market automatically updates a certain application in the background For application B, the mobile terminal will send the real-time statistical traffic to the server for analysis. When the server analyzes that the traffic of application A is too large due to changes in the network environment or the traffic of application B is automatically updated in the background When it is too large, it will send corresponding interception suggestions to the mobile terminal. For example, for application A, it will issue a prompt message "The network environment has changed from wifi to mobile data network, continuing to update will cause a lot of cost" and displayed on the mobile terminal. For the application program B, an interception instruction will be sent to the mobile terminal, and the mobile terminal will directly close the update process of the application program B after receiving the interception instruction. In addition, the technical solution provided by this embodiment can also be used to count and display the traffic consumption of the corresponding application program, and display it through the user interface, and the user can reduce the risk of "stealing traffic" by prohibiting/allowing the networking function occur. Or, when the present embodiment finds that the above-mentioned "stealing traffic" situation occurs, an alarm message of this situation is displayed through the user interface, and the user is reminded to close the "stealing traffic" application program by prohibiting/allowing the networking function.
实施例三Embodiment Three
本发明实施例可以是基于移动终端的工作原理,此移动终端安装有至少一应用程序,所述至少一应用程序可以被设置为被检测的应用程序;也可以是基于安装在终端的移动终端移动终端移动终端的工作原理,该终端可以是移动终端或手持电子设备,该终端安装有至少一应用程序,所述至少一应用程序可以被设置为被检测的应用程序。The embodiment of the present invention can be based on the working principle of the mobile terminal, the mobile terminal is installed with at least one application program, and the at least one application program can be set as the detected application program; it can also be based on the mobile terminal mobile terminal installed in the terminal The working principle of the terminal mobile terminal, the terminal may be a mobile terminal or a handheld electronic device, the terminal is installed with at least one application program, and the at least one application program can be set as the detected application program.
以下了为便于说明,假设本实施例是基于移动终端的工作原理。在本实施例中,该移动终端还安装有流量监控软件,用以通过移动终端的用户界面展示所述被检测的应用程序的流量。For ease of description, it is assumed that this embodiment is based on the working principle of a mobile terminal. In this embodiment, the mobile terminal is further installed with traffic monitoring software, which is used to display the traffic of the detected application program through the user interface of the mobile terminal.
请参阅图4,示出了本实施例应用程序的流量监控方法的流程示意图,该方法包括:Please refer to FIG. 4, which shows a schematic flow chart of the flow monitoring method of the application program in this embodiment, and the method includes:
S401、根据被检测的应用程序的标识,确定所述被检测的应用程序发起的所有链接;在这里,被检测的应用程序的标识在移动终端的操作系统中是惟一的,且与被检测的应用程序一一对应。应用程序的数据流量以该应用程序的唯一标识符作标记,根据唯一标识符(即前文所说的标识),并通过所述移动终端的流量状态获取接口(android.net.TrafficStats),该接口提供了多种静态方法,可以直接调用获取该应用程序对应的数据流量。S401. Determine all links initiated by the detected application according to the detected application ID; here, the detected application ID is unique in the operating system of the mobile terminal and is identical to the detected Apps correspond one-to-one. The data flow of the application program is marked with the unique identifier of the application program, according to the unique identifier (ie the identification mentioned above), and through the traffic status acquisition interface (android.net.TrafficStats) of the mobile terminal, the interface A variety of static methods are provided, which can be directly called to obtain the data flow corresponding to the application.
在提取数据流量之前,首先获取应用程序的唯一标识符(即前文所说的标识),唯一标识符保存在移动终端,可以通过预先设置的调用函数获取,以Andriod系统为例,通过ActivityManager我们可以获得系统里正在运行的activities,包括进程(Process)等、应用程序/包、服务(Service)、任务(Task)信息,使用ActivityManager的getRunningAppProces(获取正在运行的进程信息)方法获得RunningAppProcessInfo(正在运行的进程信息),在RunningAppProcessInfo里面会有唯一标识符UID。Before extracting the data flow, first obtain the unique identifier of the application (that is, the identifier mentioned above), the unique identifier is stored in the mobile terminal, and can be obtained through the pre-set calling function. Taking the Andriod system as an example, through the ActivityManager we can Get running activities in the system, including process (Process), application program/package, service (Service), task (Task) information, use ActivityManager's getRunningAppProces (get running process information) method to get RunningAppProcessInfo (running Process information), there will be a unique identifier UID in RunningAppProcessInfo.
S402、识别所述所有链接中的有效链接,并统计所述有效链接所使用的流量,将所述统计的流量作为所述被检测的应用程序的流量。S402. Identify valid links among all the links, and count traffic used by the valid links, and use the counted traffic as traffic of the detected application program.
在这里,需要说明的是,与通过进程确定对应应用程序的流量的方式相比,通过应用程序标识确定对应应用程序的流量的方式更为准确。因为当某一应用程序发起链接为无效链接时,此应用程序并没有消耗流量,但终端后台中仍然会存在该链接的进程,那么当通过运行的进程确定对应应用程序的流量则会比实际消耗的流量大,故该方式并不能准确地统计对应应用程序消耗的流量;而且通过进程确定对应应用程序的流量的方式还会将系统中各进程之间的通信流量作为对应应用程序之间的消耗流量,显然这些流量并不是基于运营商产生的流量,而是系统内部组件之间通信的数据量,将这些流量统计为对应应用程序的消耗流量也是不合理、不精确的。而基于应用程序标识确定对应应用程序的流量的方式,则是确定对应应用程序的有效链接,并不会统计无效链接的消耗流量,且并不会统计系统内部组件之间通信的数据量。由上述可知,基于应用程序标识确定对应应用程序的流量的方式更为合理、精确。Here, it should be noted that, compared with the method of determining the traffic of the corresponding application program through the process, the method of determining the traffic corresponding to the application program through the application program identifier is more accurate. Because when an application initiates a link that is an invalid link, the application does not consume traffic, but the process of the link still exists in the background of the terminal, so when the traffic of the corresponding application is determined by the running process, it will be more than the actual consumption. The traffic of the corresponding application is large, so this method cannot accurately count the traffic consumed by the corresponding application; and the method of determining the traffic of the corresponding application through the process will also use the communication traffic between the processes in the system as the consumption between the corresponding applications Traffic, obviously these traffic is not based on the traffic generated by the operator, but the amount of data communicated between internal components of the system, and it is unreasonable and inaccurate to count these traffic as the consumption traffic of the corresponding application. The method of determining the traffic of the corresponding application based on the application identifier is to determine the valid link of the corresponding application, and does not count the consumption traffic of the invalid link, and does not count the amount of data communicated between the internal components of the system. It can be known from the above that the method of determining the traffic of the corresponding application based on the application identifier is more reasonable and accurate.
在这里,所谓有效链接是指当前终端与对端建立了数据链路,并且能够实现双方终端有效的数据通信。Here, the so-called effective link means that the current terminal has established a data link with the opposite end, and can realize effective data communication between the two terminals.
具体的,所述识别所述所有链接中的有效链接可以通过以下方式实现,包括:Specifically, the identification of valid links among all the links may be implemented in the following ways, including:
获取域名解析请求;Obtain domain name resolution request;
在客户端通过域名进行网络访问的过程中,首先需要进行域名解析,即在域名注册商那里通过专门的域名解析服务器解析到与域名一一对应的固定IP地址,然后根据该固定IP地址访问对应的WEB服务器实现网络访问的全部过程。而如果客户端需要获取广告内容,也需要发起域名解析请求,以期解析得到广告内容提供商服务器的IP地址,本实施例在客户端发出这样的域名解析请求之前,获取该域名解析请求,执行后续流程;这里本地域名解析服务进程是由本地VPN服务提供的;将域名解析请求重定向至本地域名解析服务进程之前,还可以进行协议转换。该协议转换可由转换器来实现,例如/dev/tun设备;In the process of network access by the client through the domain name, domain name resolution is first required, that is, the domain name registrar resolves to a fixed IP address corresponding to the domain name through a dedicated domain name resolution server, and then accesses the corresponding domain name according to the fixed IP address. The WEB server realizes the whole process of network access. And if the client needs to obtain the advertisement content, it also needs to initiate a domain name resolution request in order to resolve the IP address of the advertisement content provider server. Process; here, the local domain name resolution service process is provided by the local VPN service; before the domain name resolution request is redirected to the local domain name resolution service process, protocol conversion can also be performed. The protocol conversion can be realized by a converter, such as /dev/tun device;
解析所述所有链接对应的URI,获取所述所有链接对应的主机域名;Analyzing the URIs corresponding to all the links, and obtaining the host domain names corresponding to all the links;
判断所述所有链接对应的主机域名是否存在于预设host黑名单中,并判定存在于所述预设host黑名单中的主机域名对应的链接为无效链接,不存在于所述预设host黑名单中的主机域名对应的链接为有效链接。Judging whether the host domain names corresponding to all the links exist in the preset host blacklist, and determining that the links corresponding to the host domain names existing in the preset host blacklist are invalid links and do not exist in the preset host blacklist The links corresponding to the host domain names in the list are valid links.
当判定某一链接为无效链接后,则不向所述被检测的应用程序返回所述某一链接对应的请求,从而节约了无效链接的流量。进一步的,本发明实施例还可确定所述无效链接对应的消耗流量,将所述消耗流量作为所述被检测的应用程序对应的节省流量。更进一步的,还可将对应的节省流量显示于移动终端的图形用户界面上,以更形象地形式显示节省流量的具体参数,如图3a所示。本发明实施例还可根据无效链接对应的主机域名(host域名)识别无效链接的来源,以统计此无效链接是基于哪些被检测的应用程序被拦截,以及总共被拦截的次数,例如:可识别某些插件广告或某些非法内容广告为哪家公司的广告,并且可统计这些插件广告基于哪些被检测的应用程序被拦截以及被拦截的次数。When it is determined that a certain link is an invalid link, the request corresponding to the certain link is not returned to the detected application program, thereby saving the traffic of the invalid link. Further, in this embodiment of the present invention, the consumed traffic corresponding to the invalid link may be determined, and the consumed traffic may be used as the saved traffic corresponding to the detected application program. Furthermore, the corresponding saved traffic can also be displayed on the graphical user interface of the mobile terminal, and the specific parameters of saved traffic can be displayed in a more vivid form, as shown in FIG. 3a. The embodiment of the present invention can also identify the source of the invalid link according to the host domain name (host domain name) corresponding to the invalid link, to count which detected application programs are intercepted based on the invalid link, and the total number of intercepted times, for example: identifiable Some plug-in advertisements or some illegal content advertisements are advertisements of which company, and the detected applications based on which these plug-in advertisements are blocked and the number of blocked times can be counted.
具体的,本实施例可通过获取所述无效链接的上行流量,并根据上行流量与下行流量对应的关系确定对应的下行流量,并将此上行流量和下行流量这种作为对应的节省流量。Specifically, in this embodiment, the uplink traffic of the invalid link may be acquired, and the corresponding downlink traffic may be determined according to the relationship between the uplink traffic and the downlink traffic, and the uplink traffic and the downlink traffic may be used as the corresponding saving traffic.
S403、将所述被检测的应用程序的流量与预设的所述被检测的应用程序的流量阈值进行比较,若所述被检测的应用程序的流量大于等于所述被检测的应用程序的流量阈值时,通过所述移动终端的用户界面进行流量预警提示。S403. Compare the traffic of the detected application with a preset traffic threshold of the detected application, if the traffic of the detected application is greater than or equal to the traffic of the detected application When the threshold is exceeded, a traffic warning prompt is provided through the user interface of the mobile terminal.
本实施例不仅可实现对各应用程序流量的精确、有效、全面的监控,还可在所述被检测的应用程序的流量异常时通过移动终端的用户界面进行预警提示,减少了无关流量的消耗。This embodiment can not only realize accurate, effective and comprehensive monitoring of the traffic of each application program, but also provide an early warning prompt through the user interface of the mobile terminal when the traffic of the detected application program is abnormal, reducing the consumption of irrelevant traffic .
具体的,当用户看到该预警提示后,可通过3b中的被检测的应用程序对应的开关按钮来禁止所述被检测的应用程序联网功能。Specifically, when the user sees the warning prompt, the detected application can disable the networking function of the detected application through the switch button corresponding to the detected application in 3b.
请参阅图5,为了减少了无关流量的消耗,在另一具体的实施方式中,所述通过所述移动终端的用户界面进行流量预警提示之后还包括:Please refer to FIG. 5. In order to reduce the consumption of irrelevant traffic, in another specific implementation manner, after the traffic warning prompt through the user interface of the mobile terminal further includes:
S501、接收所述移动终端发送的用户操作信息,所述用户操作信息为用户通过所述移动终端的用户界面对所述被检测的应用程序所做操作的信息,包括关闭或禁止所述应用程序的操作信息,或者包括将所述被检测的应用程序加入流量黑名单的操作信息;S501. Receive user operation information sent by the mobile terminal, where the user operation information is information about operations performed by the user on the detected application program through the user interface of the mobile terminal, including closing or prohibiting the application program operation information, or operation information including adding the detected application program to the traffic blacklist;
S502、根据所述用户操作信息进行相关的操作,包括关闭所述被检测的应用程序,或禁止所述应用程序进行网络链接,或者将所述被检测的应用程序的标识保存到所述流量黑名单中。S502. Perform related operations according to the user operation information, including closing the detected application program, or prohibiting the application program from connecting to the network, or saving the identification of the detected application program in the traffic hacker list.
在本发明实施例中,实现禁止所述应用程序进行网络链接,可以通过对试图联网的应用返回环回IP地址,使得向环回IP地址发送的HTTP请求数据包会环回到发送方,而不会到达某个接收方。从而使得网络链接失效。或者可通过向客户端的流量统计APP发送reset报文,其中,所述reset报文的报头中包括被监控应用程序的UID标识(可以设置在窗口字段),用以终止与所述被监控应用程序网络连接。In the embodiment of the present invention, to realize prohibiting the application program from performing network connection, the loopback IP address can be returned to the application trying to connect to the network, so that the HTTP request data packet sent to the loopback IP address will be looped back to the sender, and A recipient will not be reached. Thus making the network link invalid. Or by sending a reset message to the traffic statistics APP of the client, wherein, the header of the reset message includes the UID identification of the monitored application program (can be set in the window field), in order to terminate the communication with the monitored application program Internet connection.
本实施例不仅可实现对各应用程序流量的精确、有效、全面的监控,还可在所述被检测的应用程序的流量异常时通过移动终端的用户界面进行预警提示,减少了无关流量的消耗。可以协助用户在移动终端节省流量,关闭不必要的耗费流量过多的后台应用程序或者广告程序等。This embodiment can not only realize accurate, effective and comprehensive monitoring of the traffic of each application program, but also provide an early warning prompt through the user interface of the mobile terminal when the traffic of the detected application program is abnormal, reducing the consumption of irrelevant traffic . It can assist users to save traffic on mobile terminals, and close unnecessary background applications or advertising programs that consume too much traffic.
实施例四Embodiment Four
请参阅图6,示出了本实施例应用程序的流量监控装置的模块示意图,该流量监控装置包括:Please refer to FIG. 6, which shows a schematic diagram of the modules of the flow monitoring device of the application program of this embodiment, and the flow monitoring device includes:
确定单元601,用于根据被检测的应用程序的标识,确定所述被检测的应用程序发起的所有链接;A determining unit 601, configured to determine all links initiated by the detected application according to the identifier of the detected application;
统计单元602,与确定单元601连接,用于识别所述所有链接中的有效链接,并统计所述有效链接所使用的流量,将所述统计的流量作为所述被检测的应用程序的流量。The statistics unit 602 is connected with the determination unit 601, and is configured to identify valid links among all the links, and count the traffic used by the valid links, and use the counted traffic as the traffic of the detected application program.
所述统计单元602包括:The statistical unit 602 includes:
解析子单元,用于解析所述所有链接对应的URI,获取所述所有链接对应的主机域名;The parsing subunit is configured to parse the URIs corresponding to all the links, and obtain the host domain names corresponding to all the links;
判断子单元,用于判断所述所有链接对应的主机域名是否存在于预设host黑名单中,并判定存在于所述预设host黑名单中的主机域名对应的链接为无效链接,不存在于所述预设host黑名单中的主机域名对应的链接为有效链接。The judging subunit is used to judge whether the host domain names corresponding to all the links exist in the preset host blacklist, and determine that the links corresponding to the host domain names in the preset host blacklist are invalid links and do not exist in the default host blacklist. Links corresponding to host domain names in the preset host blacklist are valid links.
请参阅图7,在上述第一种可能的实现方式中,所述装置还包括:Please refer to FIG. 7. In the above first possible implementation manner, the device further includes:
展示单元603,用于通过安装所述被检测的应用程序的移动终端的用户界面展示所述被检测的应用程序的流量。The display unit 603 is configured to display the traffic of the detected application through the user interface of the mobile terminal installed with the detected application.
在上述第二种可能的实现方式中,所述装置还包括:In the above second possible implementation manner, the device further includes:
判断单元604,用于将所述被检测的应用程序的流量与预设的所述被检测的应用程序的流量阈值进行比较,若所述被检测的应用程序的流量大于等于所述被检测的应用程序的流量阈值时,通过所述移动终端的用户界面进行流量预警提示。A judging unit 604, configured to compare the traffic of the detected application with a preset traffic threshold of the detected application, and if the traffic of the detected application is greater than or equal to the detected When the traffic threshold of the application program is reached, a traffic warning prompt is provided through the user interface of the mobile terminal.
上述第三种可能的实现方式中,所述装置还包括:In the above third possible implementation manner, the device further includes:
节省单元605,用于确定所述无效链接对应的消耗流量,将所述消耗流量作为对应的节省流量。The saving unit 605 is configured to determine the consumption flow corresponding to the invalid link, and use the consumption flow as the corresponding saving flow.
请参阅图8,在上述第三种可能的实现方式中,所述判断单元604包括:Referring to FIG. 8, in the above third possible implementation manner, the judging unit 604 includes:
接收子单元6041,用于接收所述移动终端发送的用户操作信息,所述用户操作信息为用户通过所述移动终端的用户界面对所述被检测的应用程序所做操作的信息,包括关闭或禁止所述应用程序的操作信息,或者包括将所述被检测的应用程序加入流量黑名单的操作信息;The receiving subunit 6041 is configured to receive user operation information sent by the mobile terminal, the user operation information is information about the operation performed by the user on the detected application program through the user interface of the mobile terminal, including closing or prohibiting the operation information of the application program, or including the operation information of adding the detected application program to the traffic blacklist;
操作子单元6042,用于根据所述用户操作信息进行相关的操作,包括关闭所述被检测的应用程序,或禁止所述应用程序进行网络链接,或者将所述被检测的应用程序的标识保存到所述流量黑名单中。The operation subunit 6042 is configured to perform related operations according to the user operation information, including closing the detected application program, or prohibiting the application program from connecting to the network, or saving the identification of the detected application program to the traffic blacklist.
本实施例是实施例一至三对应的装置实施例,其工作原理与有益效果与实施例一至三大致相同,可参阅前述方法实施例的描述,在此不再赘述。This embodiment is a device embodiment corresponding to Embodiments 1 to 3, and its working principle and beneficial effect are substantially the same as those of Embodiments 1 to 3. Please refer to the description of the foregoing method embodiments, and will not repeat them here.
实施例五Embodiment five
本实施例提供一种移动终端,包括:上述实施例四所述的应用程序的流量监控装置。所述移动终端可以为智能手机、平板电脑等。This embodiment provides a mobile terminal, including: the apparatus for monitoring traffic of application programs described in Embodiment 4 above. The mobile terminal may be a smart phone, a tablet computer, or the like.
请参阅图9,示出了基于本实施例所适用的一实际系统图,该系统包括:至少一移动终端1001-100n以及一监控服务器103。本发明实施例可基于移动终端内部的本地VPN服务器而实现,为了便于使用VPN服务,移动终端的操作系统开放了多个系统接口(API),在得到用户确认的情况下,VPN服务能够获得控制和管理其它应用的权限。具体地,通过调用操作系统提供的API,可将移动终端内部的VPN服务打开,当移动终端的其它应用要访问网络时,应用所发起的网络连接请求均经过本地VPN服务的处理或通过上述流量统计APP控制本地VPN服务处理,使得移动终端能够有效且安全地访问网络资源。Please refer to FIG. 9 , which shows a diagram of an actual system applicable to this embodiment, and the system includes: at least one mobile terminal 1001 - 100n and a monitoring server 103 . The embodiment of the present invention can be realized based on the local VPN server inside the mobile terminal. In order to facilitate the use of VPN services, the operating system of the mobile terminal has opened a plurality of system interfaces (APIs). When the user confirms, the VPN service can be controlled. and manage permissions for other apps. Specifically, by calling the API provided by the operating system, the VPN service inside the mobile terminal can be enabled. When other applications of the mobile terminal want to access the network, the network connection requests initiated by the application are all processed by the local VPN service or passed through the above traffic. Statistics APP controls local VPN service processing, enabling mobile terminals to effectively and safely access network resources.
移动终端1001为安装有统计应用程序流量功能APP(以下简称流量统计APP)的移动终端,移动终端中另安装有至少一应用程序,移动终端1001可通过流量统计APP统计安装在移动终端1001中的各应用程序的流量。移动终端1002-100n的流量统计工作原理与移动终端1001相似,参照移动终端1001的描述即可。具体的,假设移动终端1001中安装有应用程序a、应用程序b以及流量统计APP,流量统计APP均可对于应用程序a、应用程序b以及流量统计APP的进行流量统计,其工作原理请参阅前述实施例一至四,移动终端1001可通过前述实施例一至四的原理进行各应用程序的流量统计,在这里,由于各应用程序被流量统计APP监控检测,故称之为被检测的应用程序。The mobile terminal 1001 is a mobile terminal installed with a statistical application program traffic function APP (hereinafter referred to as the traffic statistics APP), and at least one application program is installed in the mobile terminal. traffic for each application. The working principle of the traffic statistics of the mobile terminals 1002-100n is similar to that of the mobile terminal 1001, just refer to the description of the mobile terminal 1001. Specifically, assuming that the mobile terminal 1001 is installed with application program a, application program b, and traffic statistics APP, the traffic statistics APP can perform traffic statistics on application program a, application program b, and traffic statistics APP. For its working principle, please refer to the aforementioned In Embodiments 1 to 4, the mobile terminal 1001 can perform traffic statistics of each application program based on the principle of the aforementioned embodiments 1 to 4. Here, since each application program is monitored and detected by the traffic statistics APP, it is called a detected application program.
更具体的,图10示出了本发明实施例所适用的一具体系统图,该系统可以包括移动终端1001、计费系统101、VPN(虚拟专用网络,VirtualPrivate Network)服务器102和监控服务器103,在实际数据业务执行过程中,移动终端1001、计费系统101以及VPN服务器102之间建立有VPN通道104。其中,移动终端1001可以是智能手机、平板式电脑等具有移动联网服务的终端设备,本发明实施例中在移动终端1001内部创建有VPN服务,这里移动终端1001是VPN服务器的client端,即VPN client,本发明实施例中用于产生流量的数据包均经过VPN服务发送或接收。计费系统101隶属于运营商系统,用于对移动终端1001发送的上行数据包和接收的下行数据包进行流量计费,具体地,对于不同类型和不同传输量的数据业务采用不同的计费形式进行计费,以得到最终的账单。VPN服务器102是在服务器侧提供VPN服务的设备,它是VPN服务的server端,即VPN server。VPN server、VPN client以及两者之间建立的VPN通道相互配合实现在公用网络上建立虚拟专用网络,从而实现远程访问。监控服务器103是提供数据资源、数据流量分析的服务器,还可以提供资源下载的服务。移动终端1001与图9的原理大体相似,具体参阅前述描述即可。在本系统中,移动终端还可以包括多个,其原理可以参阅前述描述。More specifically, FIG. 10 shows a specific system diagram to which the embodiment of the present invention is applicable, and the system may include a mobile terminal 1001, a billing system 101, a VPN (Virtual Private Network, Virtual Private Network) server 102 and a monitoring server 103, During the execution of the actual data service, a VPN channel 104 is established among the mobile terminal 1001 , the billing system 101 and the VPN server 102 . Wherein, the mobile terminal 1001 can be a terminal device with mobile networking services such as a smart phone and a tablet computer. In the embodiment of the present invention, a VPN service is created inside the mobile terminal 1001. Here, the mobile terminal 1001 is a client end of a VPN server, namely a VPN client, the data packets used to generate traffic in the embodiment of the present invention are all sent or received through the VPN service. The billing system 101 belongs to the operator system, and is used for traffic billing for the uplink data packets sent by the mobile terminal 1001 and the downlink data packets received. Form billing to get the final bill. VPN server 102 is the equipment that provides VPN service on the server side, and it is the server end of VPN service, namely VPN server. The VPN server, VPN client and the VPN channel established between them cooperate with each other to establish a virtual private network on the public network, thereby realizing remote access. The monitoring server 103 is a server that provides data resources and data flow analysis, and can also provide resource download services. The principle of the mobile terminal 1001 is generally similar to that of FIG. 9 , and details can be referred to the foregoing description. In this system, there may also be multiple mobile terminals, and the principle may refer to the foregoing description.
本发明实施例中,这里的上行数据包可以为用于下载资源服务器提供的资源的HTTP请求数据包。在客户端要发送该HTTP请求数据包之前,首先对HTTP请求数据包进行压缩,经过压缩后的HTTP请求数据包(即上行压缩数据包)的数据量要小于压缩前的HTTP请求数据包,以达到减小数据传输量进而节省流量的目的。In the embodiment of the present invention, the uplink data packet here may be an HTTP request data packet for downloading resources provided by the resource server. Before the client wants to send the HTTP request packet, it first compresses the HTTP request packet. The purpose of reducing the amount of data transmission and thus saving traffic is achieved.
在VPN服务器接收到上行压缩数据包之后,对上行压缩数据包进行解压缩处理,然后发送给对应的资源服务器。在此次上行数据包传输过程中,计费系统已经对上行压缩数据包进行了计费处理,VPN服务器传递给资源服务器的上行数据包不涉及计费,因此VPN服务器对上行压缩数据包进行解压缩后发送给资源服务器,以请求相应的资源。After the VPN server receives the uplink compressed data packet, it decompresses the uplink compressed data packet, and then sends it to a corresponding resource server. During the transmission process of the uplink data packet, the billing system has already performed billing processing on the uplink compressed data packet, and the uplink data packet passed by the VPN server to the resource server does not involve billing, so the VPN server decompresses the uplink compressed data packet. After compression, send it to the resource server to request the corresponding resource.
客户端内部配置有压缩进程,在客户端要发送该HTTP请求数据包之前,调用压缩进程对HTTP请求数据包进行压缩,经过压缩后的HTTP请求数据包的数据量要小于压缩前的HTTP请求数据包,以达到减小数据传输量,从而节省流量的目的。The client is equipped with a compression process. Before the client sends the HTTP request packet, the compression process is called to compress the HTTP request packet. The data volume of the compressed HTTP request packet is smaller than the HTTP request data before compression. packets to achieve the purpose of reducing the amount of data transmission and thus saving traffic.
可选地,压缩进程包含对HTTP头信息进行压缩的压缩子进程和对上行数据进行压缩的压缩子进程。Optionally, the compression process includes a compression sub-process for compressing HTTP header information and a compression sub-process for compressing upstream data.
具体地,在对HTTP头信息进行压缩之前,需要预先建立字符库。一般来说,目前有许多对数据进行压缩的算法,使得数据的压缩相对来说较为容易实施。但是对于HTTP头信息来说,由于HTTP头信息中包含的均为字母、单词等字符单元,而且HTTP头信息传输的都是较为重要的信息,这些字符不容易被压缩,而且一旦压缩算法出现折损,会导致信息传输出现错误,从而导致下载资源失败。鉴于这些问题,本发明提出了建立字符库对HTTP头信息进行压缩的方法,这种压缩方式出现折损的概率很低,且具有一定的压缩率。Specifically, before compressing the HTTP header information, a character library needs to be established in advance. Generally speaking, there are currently many algorithms for compressing data, making data compression relatively easy to implement. But for the HTTP header information, since the HTTP header information contains character units such as letters and words, and the HTTP header information transmits relatively important information, these characters are not easy to be compressed, and once the compression algorithm fails If it is damaged, it will cause errors in information transmission, which will lead to failure of downloading resources. In view of these problems, the present invention proposes a method of establishing a character library to compress HTTP header information. This compression method has a very low probability of loss and has a certain compression rate.
具体地,字符库的建立过程为:选取常见的HTTP请求数据包,通过程序分析这些常见的HTTP请求数据包中的HTTP头信息,从中解析出常见的字符(包含字、词及其组合),按照这些字符出现的频率对这些字符进行排序,选取排序靠前的字符加入字符库中,例如选取排在前20位的字符。本发明中,字符库的建立过程不仅限于上述过程,旨在选取常见字符加入字符库的方法均属于本发明所要保护的范围。Specifically, the establishment process of the character library is: select common HTTP request packets, analyze the HTTP header information in these common HTTP request packets through programs, and parse out common characters (including words, words and combinations thereof) therefrom, These characters are sorted according to the frequency of occurrence of these characters, and the characters ranked first are selected to be added to the character library, for example, the characters ranked first 20 are selected. In the present invention, the establishment process of the character library is not limited to the above-mentioned process, and methods aiming at selecting common characters to add to the character library all belong to the protection scope of the present invention.
在预先建立了字符库的前提下,对HTTP头信息进行压缩的压缩子进程将HTTP头信息所包含的字符与字符库内的字符进行比对,若比对一致,则将上行数据包中的HTTP头信息所包含的字符替换为该字符在字符库内的偏移值。以HTTP头信息中包含的GET信息“GET/simple.htm HTTP/1.1”为例,压缩子进程将其中的“GET”、“simple.htm”、“HTTP”和“1.1”等字符与字符库内的字符进行比对,发现“GET”、“HTTP”和“1.1”都分别与字符库内的某字符比对一致,则将这些字符替换为字符在字符库内的偏移值,如:将“GET”替换为“1”,“HTTP”替换为“3”,“1.1”替换为“5”,其中,“1”、“3”、“5”分别为相应字符在字符库内的偏移值,该偏移值可以为上述字符库内排序的序号,本发明对此不做限制。On the premise that the character library is established in advance, the compression subprocess for compressing the HTTP header information compares the characters contained in the HTTP header information with the characters in the character library. The character contained in the HTTP header information is replaced with the offset value of the character in the character library. Taking the GET information "GET/simple.htm HTTP/1.1" contained in the HTTP header information as an example, the compression sub-process converts characters and character libraries such as "GET", "simple.htm", "HTTP" and "1.1" Compare the characters in the character library, and find that "GET", "HTTP" and "1.1" are all consistent with a character in the character library, then replace these characters with the offset value of the character in the character library, such as: Replace "GET" with "1", "HTTP" with "3", and "1.1" with "5", where "1", "3", and "5" are the corresponding characters in the character library An offset value, the offset value may be the serial number sorted in the above character library, which is not limited in the present invention.
对于上行数据包内的上行数据,考虑到上行数据传输量一般远小于下行数据传输量,因此本发明实施例在对上行数据进行压缩时优选使用较少系统资源但压缩率不一定很高的压缩算法,例如Gzip压缩算法或zlib压缩算法。采用这种压缩算法能够减少对客户端系统资源的占用率,避免了影响客户端的运行速度,同时也避免了过多的耗费客户端的电量。For the uplink data in the uplink data packet, considering that the amount of uplink data transmission is generally much smaller than the amount of downlink data transmission, the embodiment of the present invention preferably uses less system resources when compressing uplink data but the compression rate is not necessarily high. Algorithm, such as Gzip compression algorithm or zlib compression algorithm. The use of this compression algorithm can reduce the occupancy rate of system resources of the client, avoid affecting the running speed of the client, and avoid excessive consumption of power of the client.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other.
可以理解的是,上述方法及交换机中的相关特征可以相互参考。另外,上述实施例中的“第一”、“第二”等是用于区分各实施例,而并不代表各实施例的优劣。It can be understood that the above methods and related features in the switch can refer to each other. In addition, "first", "second" and so on in the above embodiments are used to distinguish each embodiment, and do not represent the advantages and disadvantages of each embodiment.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例提供的装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components in the device provided according to the embodiments of the present invention. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.
本发明一方面公开A1、一种应用程序的流量监控方法,包括:On the one hand, the present invention discloses A1, a traffic monitoring method of an application program, comprising:
根据被检测的应用程序的标识,确定所述被检测的应用程序发起的所有链接;determining all links initiated by the detected application according to the identifier of the detected application;
识别所述所有链接中的有效链接,并统计所述有效链接所使用的流量,将所述统计的流量作为所述被检测的应用程序的流量。Identify valid links among all the links, count the traffic used by the valid links, and use the counted traffic as the traffic of the detected application program.
A2、如A1所述的方法,所述识别所述所有链接中的有效链接包括:A2. The method as described in A1, the identifying valid links in all the links includes:
解析所述所有链接对应的URI,获取所述所有链接对应的主机域名;Analyzing the URIs corresponding to all the links, and obtaining the host domain names corresponding to all the links;
判断所述所有链接对应的主机域名是否存在于预设host黑名单中,并判定存在于所述预设host黑名单中的主机域名对应的链接为无效链接,不存在于所述预设host黑名单中的主机域名对应的链接为有效链接。Judging whether the host domain names corresponding to all the links exist in the preset host blacklist, and determining that the links corresponding to the host domain names existing in the preset host blacklist are invalid links and do not exist in the preset host blacklist The links corresponding to the host domain names in the list are valid links.
A3、如A2所述的方法,还包括:确定所述无效链接对应的消耗流量,将所述消耗流量作为对应的节省流量。A3. The method according to A2, further comprising: determining the consumption flow corresponding to the invalid link, and using the consumption flow as the corresponding saving flow.
A4、如A1所述的方法,所述将所述统计的流量作为所述被检测的应用程序的流量之后,包括:A4. The method as described in A1, after using the counted traffic as the traffic of the detected application program, including:
通过安装所述被检测的应用程序的移动终端的用户界面展示所述被检测的应用程序的流量。The traffic of the detected application is displayed through the user interface of the mobile terminal installed with the detected application.
A5、如A1所述的方法,所述将所述统计的流量作为所述被检测的应用程序的流量之后,包括:A5. The method as described in A1, after using the counted traffic as the traffic of the detected application program, including:
将所述被检测的应用程序的流量与预设的所述被检测的应用程序的流量阈值进行比较,若所述被检测的应用程序的流量大于等于所述被检测的应用程序的流量阈值时,通过所述移动终端的用户界面进行流量预警提示。comparing the traffic of the detected application with a preset traffic threshold of the detected application, if the traffic of the detected application is greater than or equal to the traffic threshold of the detected application , performing a traffic warning prompt through the user interface of the mobile terminal.
A6、如A5所述的方法,所述通过所述移动终端的用户界面进行流量预警提示之后,包括:A6. The method as described in A5, after the traffic warning prompt is performed through the user interface of the mobile terminal, it includes:
接收所述移动终端发送的用户操作信息,所述用户操作信息为用户通过所述移动终端的用户界面对所述被检测的应用程序所做操作的信息,包括关闭或禁止所述应用程序的操作信息,或者包括将所述被检测的应用程序加入流量黑名单的操作信息;receiving user operation information sent by the mobile terminal, where the user operation information is information on operations performed by the user on the detected application program through the user interface of the mobile terminal, including closing or prohibiting the operation of the application program information, or include operational information for adding the detected application to a traffic blacklist;
根据所述用户操作信息进行相关的操作,包括关闭所述被检测的应用程序,或禁止所述应用程序进行网络链接,或者将所述被检测的应用程序的标识保存到所述流量黑名单中。Perform relevant operations according to the user operation information, including closing the detected application program, or prohibiting the application program from connecting to the network, or saving the identification of the detected application program in the traffic blacklist .
本发明还公开了B7、一种应用程序的流量监控装置,包括:The present invention also discloses B7, a flow monitoring device for application programs, comprising:
确定单元,用于根据被检测的应用程序的标识,确定所述被检测的应用程序发起的所有链接;A determining unit, configured to determine all links initiated by the detected application program according to the identifier of the detected application program;
统计单元,用于识别所述所有链接中的有效链接,并统计所述有效链接所使用的流量,将所述统计的流量作为所述被检测的应用程序的流量。The statistical unit is configured to identify valid links among all the links, and count the traffic used by the valid links, and use the counted traffic as the traffic of the detected application program.
B8、如B7所述的装置,所述统计单元包括:B8, the device as described in B7, the statistical unit includes:
解析子单元,用于解析所述所有链接对应的URI,获取所述所有链接对应的主机域名;The parsing subunit is configured to parse the URIs corresponding to all the links, and obtain the host domain names corresponding to all the links;
判断子单元,用于判断所述所有链接对应的主机域名是否存在于预设host黑名单中,并判定存在于所述预设host黑名单中的主机域名对应的链接为无效链接,不存在于所述预设host黑名单中的主机域名对应的链接为有效链接。The judging subunit is used to judge whether the host domain names corresponding to all the links exist in the preset host blacklist, and determine that the links corresponding to the host domain names in the preset host blacklist are invalid links and do not exist in the default host blacklist. Links corresponding to host domain names in the preset host blacklist are valid links.
B9、如B8所述的装置,所述装置还包括节省单元:用于确定所述无效链接对应的消耗流量,将所述消耗流量作为对应的节省流量。B9. The device according to B8, further comprising a saving unit: configured to determine the consumption flow corresponding to the invalid link, and use the consumption flow as the corresponding saving flow.
B10、如B7所述的装置,所述装置还包括:B10, the device as described in B7, said device also includes:
展示单元,用于通过安装所述被检测的应用程序的移动终端的用户界面展示所述被检测的应用程序的流量。The display unit is configured to display the traffic of the detected application program through the user interface of the mobile terminal installed with the detected application program.
B11、如B7所述的装置,所述装置还包括:B11, the device as described in B7, said device also includes:
判断单元,用于将所述被检测的应用程序的流量与预设的所述被检测的应用程序的流量阈值进行比较,若所述被检测的应用程序的流量大于等于所述被检测的应用程序的流量阈值时,通过所述移动终端的用户界面进行流量预警提示。a judging unit, configured to compare the traffic of the detected application with a preset traffic threshold of the detected application, and if the traffic of the detected application is greater than or equal to the traffic of the detected application When the flow threshold of the program is reached, the user interface of the mobile terminal is used to provide a flow warning prompt.
B12、如B11所述的装置,所述判断单元包括:B12, the device as described in B11, the judgment unit includes:
接收子单元,用于接收所述移动终端发送的用户操作信息,所述用户操作信息为用户通过所述移动终端的用户界面对所述被检测的应用程序所做操作的信息,包括关闭或禁止所述应用程序的操作信息,或者包括将所述被检测的应用程序加入流量黑名单的操作信息;The receiving subunit is configured to receive user operation information sent by the mobile terminal, the user operation information is information about the operation performed by the user on the detected application program through the user interface of the mobile terminal, including closing or prohibiting The operation information of the application program, or including the operation information of adding the detected application program to the traffic blacklist;
操作子单元,用于根据所述用户操作信息进行相关的操作,包括关闭所述被检测的应用程序,或禁止所述应用程序进行网络链接,或者将所述被检测的应用程序的标识保存到所述流量黑名单中。An operation subunit, configured to perform related operations according to the user operation information, including closing the detected application program, or prohibiting the application program from connecting to the network, or saving the identification of the detected application program in the In the traffic blacklist.
本发明还公开了C13、一种移动终端,包括:如权利要求7-12任一项所述的应用程序的流量监控装置。The present invention also discloses C13, a mobile terminal, comprising: a flow monitoring device for an application program according to any one of claims 7-12.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410690841.XA CN104484259A (en) | 2014-11-25 | 2014-11-25 | Application program traffic monitoring method and device, and mobile terminal |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410690841.XA CN104484259A (en) | 2014-11-25 | 2014-11-25 | Application program traffic monitoring method and device, and mobile terminal |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN104484259A true CN104484259A (en) | 2015-04-01 |
Family
ID=52758803
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201410690841.XA Pending CN104484259A (en) | 2014-11-25 | 2014-11-25 | Application program traffic monitoring method and device, and mobile terminal |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN104484259A (en) |
Cited By (30)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104869595A (en) * | 2015-05-04 | 2015-08-26 | 小米科技有限责任公司 | Method and device for controlling data traffic |
| CN105163290A (en) * | 2015-07-28 | 2015-12-16 | 小米科技有限责任公司 | Roaming prompting method and apparatus |
| CN105607979A (en) * | 2015-12-18 | 2016-05-25 | 小米科技有限责任公司 | Network interconnection control method and device |
| CN105635178A (en) * | 2016-02-26 | 2016-06-01 | 北京奇虎科技有限公司 | Blocking network access method and device for ensuring safety |
| CN105764095A (en) * | 2016-02-22 | 2016-07-13 | 苏州蜗牛数字科技股份有限公司 | Application identification and control system and application identification and control method based on virtual private network |
| CN105848290A (en) * | 2016-05-20 | 2016-08-10 | 青岛海信移动通信技术股份有限公司 | Traffic reminding method, terminal and server |
| CN106021072A (en) * | 2016-05-05 | 2016-10-12 | 北京小米移动软件有限公司 | Information display method and device |
| CN106161379A (en) * | 2015-04-13 | 2016-11-23 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus detecting wooden horse |
| CN106211119A (en) * | 2016-06-30 | 2016-12-07 | 深圳优克云联科技有限公司 | A kind of flow processing method, Apparatus and system |
| WO2016191977A1 (en) * | 2015-05-29 | 2016-12-08 | 华为技术有限公司 | Operation processing method and device |
| CN106295312A (en) * | 2016-08-19 | 2017-01-04 | 硕诺科技(深圳)有限公司 | A kind of mobile terminal limits the method that application program accesses network |
| CN106375978A (en) * | 2015-07-20 | 2017-02-01 | 中兴通讯股份有限公司 | Flow monitoring method and terminal |
| CN106371970A (en) * | 2016-08-29 | 2017-02-01 | 北京小米移动软件有限公司 | Application monitoring method and device |
| CN106792618A (en) * | 2016-11-30 | 2017-05-31 | 宇龙计算机通信科技(深圳)有限公司 | Flux monitoring method and device and terminal |
| CN106789443A (en) * | 2017-01-13 | 2017-05-31 | 百度在线网络技术(北京)有限公司 | The method and apparatus of network access request analysis result is presented |
| CN106937282A (en) * | 2015-12-29 | 2017-07-07 | 北界创想(北京)软件有限公司 | VPN access method and system based on mobile terminal |
| JP2017139741A (en) * | 2016-12-08 | 2017-08-10 | 京セラ株式会社 | Communication device, communication control method and program |
| CN107395744A (en) * | 2017-08-18 | 2017-11-24 | 广东欧珀移动通信有限公司 | Data synchronization method, mobile terminal and storage medium |
| CN107483419A (en) * | 2017-07-28 | 2017-12-15 | 深圳市优克联新技术有限公司 | Method, device, system, server, and computer-readable storage medium for server authentication access terminal |
| CN107634940A (en) * | 2017-08-30 | 2018-01-26 | 努比亚技术有限公司 | Control method, terminal, server and the readable storage medium storing program for executing that a kind of flow uses |
| CN107783806A (en) * | 2016-08-24 | 2018-03-09 | 中兴通讯股份有限公司 | A kind of method and device for arranging icon |
| CN108307337A (en) * | 2017-08-22 | 2018-07-20 | 深圳市爱培科技术股份有限公司 | Flux monitoring method, system and the storage device of vehicle mounted guidance terminal |
| CN109120482A (en) * | 2018-09-28 | 2019-01-01 | 北京小米移动软件有限公司 | Monitor the method and device that application program uses flow |
| WO2019010734A1 (en) * | 2017-07-12 | 2019-01-17 | 网宿科技股份有限公司 | Method and system for guiding service application traffic |
| CN109582585A (en) * | 2018-12-18 | 2019-04-05 | 网宿科技股份有限公司 | A kind of method and apparatus of detection application traffic leakage |
| CN109873874A (en) * | 2019-03-18 | 2019-06-11 | 北京智明星通科技股份有限公司 | The requesting method and equipment of game APP data |
| CN110213198A (en) * | 2018-02-28 | 2019-09-06 | 中标软件有限公司 | The monitoring method and system of network flow |
| CN110392057A (en) * | 2019-07-30 | 2019-10-29 | 秒针信息技术有限公司 | The method and device for monitoring abnormal flow, encrypting monitoring code |
| CN111224893A (en) * | 2019-12-30 | 2020-06-02 | 中国人民解放军国防科技大学 | VPN-based android mobile phone traffic collection and labeling system and method |
| CN118631693A (en) * | 2024-06-14 | 2024-09-10 | 浪潮云信息技术股份公司 | A network traffic monitoring device based on SFlow technology |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102916845A (en) * | 2011-08-01 | 2013-02-06 | 中兴通讯股份有限公司 | Multi-path loopback detecting method and exchanger equipment |
| CN104009892A (en) * | 2014-06-12 | 2014-08-27 | 北京奇虎科技有限公司 | Method, device and client for monitoring mobile terminal traffic |
| CN104092972A (en) * | 2014-07-15 | 2014-10-08 | 北京小鱼儿科技有限公司 | Communication terminal and tool installed on mobile terminal |
| CN104159231A (en) * | 2014-08-19 | 2014-11-19 | 北京奇虎科技有限公司 | Method for optimizing background flow of client, and client |
-
2014
- 2014-11-25 CN CN201410690841.XA patent/CN104484259A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102916845A (en) * | 2011-08-01 | 2013-02-06 | 中兴通讯股份有限公司 | Multi-path loopback detecting method and exchanger equipment |
| CN104009892A (en) * | 2014-06-12 | 2014-08-27 | 北京奇虎科技有限公司 | Method, device and client for monitoring mobile terminal traffic |
| CN104092972A (en) * | 2014-07-15 | 2014-10-08 | 北京小鱼儿科技有限公司 | Communication terminal and tool installed on mobile terminal |
| CN104159231A (en) * | 2014-08-19 | 2014-11-19 | 北京奇虎科技有限公司 | Method for optimizing background flow of client, and client |
Cited By (45)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106161379B (en) * | 2015-04-13 | 2019-09-03 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus detecting wooden horse |
| CN106161379A (en) * | 2015-04-13 | 2016-11-23 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus detecting wooden horse |
| CN104869595A (en) * | 2015-05-04 | 2015-08-26 | 小米科技有限责任公司 | Method and device for controlling data traffic |
| CN107409327B (en) * | 2015-05-29 | 2021-07-09 | 华为技术有限公司 | A kind of processing operation method and equipment |
| US10560871B2 (en) | 2015-05-29 | 2020-02-11 | Huawei Technologies Co., Ltd. | Operation processing method and device |
| CN107409327A (en) * | 2015-05-29 | 2017-11-28 | 华为技术有限公司 | One kind processing operating method and equipment |
| WO2016191977A1 (en) * | 2015-05-29 | 2016-12-08 | 华为技术有限公司 | Operation processing method and device |
| CN106375978A (en) * | 2015-07-20 | 2017-02-01 | 中兴通讯股份有限公司 | Flow monitoring method and terminal |
| CN105163290A (en) * | 2015-07-28 | 2015-12-16 | 小米科技有限责任公司 | Roaming prompting method and apparatus |
| CN105163290B (en) * | 2015-07-28 | 2019-12-13 | 小米科技有限责任公司 | roaming prompting method and device |
| CN105607979B (en) * | 2015-12-18 | 2018-05-08 | 小米科技有限责任公司 | Networking control method and device |
| CN105607979A (en) * | 2015-12-18 | 2016-05-25 | 小米科技有限责任公司 | Network interconnection control method and device |
| CN106937282B (en) * | 2015-12-29 | 2020-12-18 | 北界创想(北京)软件有限公司 | VPN access method and system based on mobile terminal |
| CN106937282A (en) * | 2015-12-29 | 2017-07-07 | 北界创想(北京)软件有限公司 | VPN access method and system based on mobile terminal |
| CN105764095B (en) * | 2016-02-22 | 2020-08-21 | 世纪蜗牛通信科技有限公司 | Application identification and control system and method based on virtual private network |
| CN105764095A (en) * | 2016-02-22 | 2016-07-13 | 苏州蜗牛数字科技股份有限公司 | Application identification and control system and application identification and control method based on virtual private network |
| CN105635178B (en) * | 2016-02-26 | 2018-06-22 | 北京奇虎科技有限公司 | Ensure the block type Network Access Method and device of safety |
| CN105635178A (en) * | 2016-02-26 | 2016-06-01 | 北京奇虎科技有限公司 | Blocking network access method and device for ensuring safety |
| CN106021072A (en) * | 2016-05-05 | 2016-10-12 | 北京小米移动软件有限公司 | Information display method and device |
| CN105848290A (en) * | 2016-05-20 | 2016-08-10 | 青岛海信移动通信技术股份有限公司 | Traffic reminding method, terminal and server |
| CN106211119A (en) * | 2016-06-30 | 2016-12-07 | 深圳优克云联科技有限公司 | A kind of flow processing method, Apparatus and system |
| CN106211119B (en) * | 2016-06-30 | 2019-05-21 | 深圳优克云联科技有限公司 | A kind of flow processing method, apparatus and system |
| CN106295312A (en) * | 2016-08-19 | 2017-01-04 | 硕诺科技(深圳)有限公司 | A kind of mobile terminal limits the method that application program accesses network |
| CN107783806A (en) * | 2016-08-24 | 2018-03-09 | 中兴通讯股份有限公司 | A kind of method and device for arranging icon |
| CN106371970B (en) * | 2016-08-29 | 2019-08-02 | 北京小米移动软件有限公司 | Using monitoring method and device |
| CN106371970A (en) * | 2016-08-29 | 2017-02-01 | 北京小米移动软件有限公司 | Application monitoring method and device |
| CN106792618A (en) * | 2016-11-30 | 2017-05-31 | 宇龙计算机通信科技(深圳)有限公司 | Flux monitoring method and device and terminal |
| JP2017139741A (en) * | 2016-12-08 | 2017-08-10 | 京セラ株式会社 | Communication device, communication control method and program |
| CN106789443A (en) * | 2017-01-13 | 2017-05-31 | 百度在线网络技术(北京)有限公司 | The method and apparatus of network access request analysis result is presented |
| WO2019010734A1 (en) * | 2017-07-12 | 2019-01-17 | 网宿科技股份有限公司 | Method and system for guiding service application traffic |
| US11012359B2 (en) | 2017-07-12 | 2021-05-18 | Wangsu Science & Technology Co., Ltd. | Method and system for redirecting service application traffic |
| CN107483419A (en) * | 2017-07-28 | 2017-12-15 | 深圳市优克联新技术有限公司 | Method, device, system, server, and computer-readable storage medium for server authentication access terminal |
| CN107483419B (en) * | 2017-07-28 | 2020-06-09 | 深圳市优克联新技术有限公司 | Method, device and system for authenticating access terminal by server, server and computer readable storage medium |
| CN107395744A (en) * | 2017-08-18 | 2017-11-24 | 广东欧珀移动通信有限公司 | Data synchronization method, mobile terminal and storage medium |
| CN108307337A (en) * | 2017-08-22 | 2018-07-20 | 深圳市爱培科技术股份有限公司 | Flux monitoring method, system and the storage device of vehicle mounted guidance terminal |
| CN107634940A (en) * | 2017-08-30 | 2018-01-26 | 努比亚技术有限公司 | Control method, terminal, server and the readable storage medium storing program for executing that a kind of flow uses |
| CN110213198A (en) * | 2018-02-28 | 2019-09-06 | 中标软件有限公司 | The monitoring method and system of network flow |
| CN109120482A (en) * | 2018-09-28 | 2019-01-01 | 北京小米移动软件有限公司 | Monitor the method and device that application program uses flow |
| CN109582585A (en) * | 2018-12-18 | 2019-04-05 | 网宿科技股份有限公司 | A kind of method and apparatus of detection application traffic leakage |
| CN109873874A (en) * | 2019-03-18 | 2019-06-11 | 北京智明星通科技股份有限公司 | The requesting method and equipment of game APP data |
| CN110392057A (en) * | 2019-07-30 | 2019-10-29 | 秒针信息技术有限公司 | The method and device for monitoring abnormal flow, encrypting monitoring code |
| CN110392057B (en) * | 2019-07-30 | 2021-09-10 | 秒针信息技术有限公司 | Method and device for monitoring abnormal flow and encrypting monitoring code |
| CN111224893A (en) * | 2019-12-30 | 2020-06-02 | 中国人民解放军国防科技大学 | VPN-based android mobile phone traffic collection and labeling system and method |
| CN118631693A (en) * | 2024-06-14 | 2024-09-10 | 浪潮云信息技术股份公司 | A network traffic monitoring device based on SFlow technology |
| CN118631693B (en) * | 2024-06-14 | 2026-01-09 | 浪潮云信息技术股份公司 | A network traffic monitoring device based on SFlow technology |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104484259A (en) | Application program traffic monitoring method and device, and mobile terminal | |
| US11463460B1 (en) | Network traffic inspection | |
| US10445502B1 (en) | Susceptible environment detection system | |
| CN103051617B (en) | The method of the network behavior of recognizer, Apparatus and system | |
| US9398028B1 (en) | System, device and method for detecting a malicious attack based on communcations between remotely hosted virtual machines and malicious web servers | |
| US9055090B2 (en) | Network based device security and controls | |
| EP2755157B1 (en) | Detecting undesirable content | |
| US20140096246A1 (en) | Protecting users from undesirable content | |
| US10607016B2 (en) | Decrypting files for data leakage protection in an enterprise network | |
| WO2015007231A1 (en) | Method and device for identification of malicious url | |
| US9092615B1 (en) | Identifying application sources on non-rooted devices | |
| CN105323261A (en) | Data detection method and device | |
| US12155624B2 (en) | System and method of protecting a network | |
| CN104463569A (en) | Secure connection payment method and device | |
| CN106156611A (en) | The dynamic analysing method of smart mobile phone application program and system | |
| CN103577749A (en) | Method and device for processing notification column message | |
| CN106899549A (en) | A kind of network security detection method and device | |
| CN102594780B (en) | The detection of mobile terminal virus, sweep-out method and device | |
| US12393862B2 (en) | Creating and using learning models to identify botnet traffic | |
| US10313373B2 (en) | System and method of protecting a network | |
| CN111355682A (en) | Email sending method and email proxy server | |
| Barbera et al. | Cdroid: Towards a cloud-integrated mobile operating system | |
| CN103067360B (en) | Program network Activity recognition method and system | |
| Hutchinson et al. | Forensic analysis of spy applications in android devices | |
| CN114978637A (en) | Message processing method and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20150401 |
|
| RJ01 | Rejection of invention patent application after publication |