CN109587643B - Method and device for detecting flow leakage of application - Google Patents

Method and device for detecting flow leakage of application Download PDF

Info

Publication number
CN109587643B
CN109587643B CN201811555328.4A CN201811555328A CN109587643B CN 109587643 B CN109587643 B CN 109587643B CN 201811555328 A CN201811555328 A CN 201811555328A CN 109587643 B CN109587643 B CN 109587643B
Authority
CN
China
Prior art keywords
target application
application
target
test
state information
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.)
Expired - Fee Related
Application number
CN201811555328.4A
Other languages
Chinese (zh)
Other versions
CN109587643A (en
Inventor
陈子为
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN201811555328.4A priority Critical patent/CN109587643B/en
Publication of CN109587643A publication Critical patent/CN109587643A/en
Application granted granted Critical
Publication of CN109587643B publication Critical patent/CN109587643B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/24Accounting or billing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0888Throughput
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/08Testing, supervising or monitoring using real traffic

Abstract

The invention discloses a method and a device for detecting flow leakage of an application, and belongs to the technical field of computers. The method comprises the following steps: a test process receives a flow test instruction aiming at a target application and starts the target application; when the target application is subjected to scene simulation, the test process acquires the network access state information of each process of the target application through a transport layer data record file corresponding to each process of the target application in a system management directory; and the test process judges whether each process of the target application has flow leakage or not according to the network access state information and a preset directional IP address of the target application. By adopting the invention, the time and labor cost for detecting the flow leakage of the application can be reduced, and the efficiency for detecting the flow leakage of the application is improved.

Description

Method and device for detecting flow leakage of application
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for detecting flow leakage of an application.
Background
The directional traffic charging is a charging mode for data traffic of a specific application based on a CDN cluster and a mobile network. For an application a with a directional flow metering cost function, the CDN service side may aggregate application resources on destination IP addresses requested by the application a to the same CDN node. In this way, when the user uses the application a, the network operator may perform directional traffic charging on the data traffic generated by the application a by counting the data traffic (which may be referred to as directional traffic) of the application a on the CDN node.
When the application a is running, a part of requests addressed to other IP addresses may occur, and these IP addresses (which may be referred to as non-directional IP addresses) are not summarized to the CDN node, so that the network operator charges the requested data traffic (which may be referred to as non-directional traffic) according to a general traffic charging manner, thereby increasing traffic charges of the user and affecting user experience of the application and the mobile network. For this reason, in the process of developing the directional flow meter function for an application, it is necessary to perform a test check on the non-directional flow in the application to determine whether the non-directional flow is generated during the operation of the application, that is, whether there is a problem of flow leakage.
For application A in an android system, when testing and checking non-directional flow, technicians can connect terminal equipment running with the application A to test equipment first, and then filter network data packets generated by the terminal equipment on the test equipment through a network packet capturing tool when a user use scene of the application A is simulated. Then, a technician may extract information of the filtered network data packet, determine whether the network data packet is sent by the application a, and whether the network data packet is sent to a summarized IP address (which may be referred to as a directional IP address), and determine whether the application a has a problem of traffic leakage according to a determination result.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
first, limited by the performance of software/hardware, a terminal device can be tested only by one testing device, which is inefficient; secondly, as the network communication of the android system background application cannot be completely closed, the checking result is greatly interfered; thirdly, the non-directional flow is tested and checked manually, the time and labor cost is high, and meanwhile, the accuracy of the checking result is difficult to guarantee.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for detecting a flow leakage of an application. The technical scheme is as follows:
in a first aspect, a method for performing traffic leakage detection on an application is provided, the method including:
a test process receives a flow test instruction aiming at a target application and starts the target application;
when the target application is subjected to scene simulation, the test process acquires the network access state information of each process of the target application through a transport layer data record file corresponding to each process of the target application in a system management directory;
and the test process judges whether each process of the target application has flow leakage or not according to the network access state information and a preset directional IP address of the target application.
Optionally, after the test process starts the target application, the method further includes:
and the test process executes the shell command, and acquires the process identification information of each process of the target application according to the application identification of the target application.
Optionally, the obtaining, by the test process, network access state information of each process of the target application through a transport layer data record file corresponding to each process of the target application in a system management directory includes:
for the target process of the target application, the test process searches a target file directory named based on the process identification information of the target process in a system management directory, and obtains the network access state information of the target process through a transmission layer data record file in the target file directory.
Optionally, the obtaining, by the test process, network access state information of each process of the target application through a transport layer data record file corresponding to each process of the target application in a system management directory includes:
the test process periodically traverses a transport layer data record file corresponding to each process of the target application in a system management directory to generate a state information comparison table corresponding to each process, wherein the state information comparison table at least comprises a connection state of network access connection of the process and an opposite terminal address;
and traversing the state information comparison table corresponding to each process by the test process to acquire the network access state information of each process of the target application.
Optionally, before the testing process determines whether each process of the target application has traffic leakage according to the network access state information and a preset directional IP address of the target application, the method further includes:
and the test process carries out the system conversion on the address of the opposite terminal of the network access connection in the state information comparison table corresponding to each process.
Optionally, after the test process starts the target application, the method further includes:
and the test process sends different application operation instructions to the application process of the target application based on preset application simulation operation corresponding to the target application.
Optionally, the method further includes:
when detecting that the target process of the target application has flow leakage, the test process determines a target application operation instruction which is recently sent to the application process;
and the test process sends the target application operation instruction to the application process again and monitors the transport layer data record file corresponding to the target process in the system management directory.
In a second aspect, an apparatus for performing traffic leakage detection on an application is provided, where the apparatus runs a test process, and the test process is configured to:
receiving a flow test instruction aiming at a target application, and starting the target application;
when the target application is subjected to scene simulation, network access state information of each process of the target application is obtained through a transport layer data recording file corresponding to each process of the target application in a system management directory;
and judging whether each process of the target application has flow leakage or not according to the network access state information and a preset directional IP address of the target application.
Optionally, the test process is further configured to:
and after the target application is started, executing a shell command, and acquiring process identification information of each process of the target application according to the application identification of the target application.
Optionally, the test process is specifically configured to:
and for the target process of the target application, searching a target file directory named based on the process identification information of the target process in a system management directory, and acquiring the network access state information of the target process through a transmission layer data record file in the target file directory.
Optionally, the test process is specifically configured to:
periodically traversing a transport layer data record file corresponding to each process of the target application in a system management directory to generate a state information comparison table corresponding to each process, wherein the state information comparison table at least comprises a connection state of network access connection of the process and an opposite terminal address;
and traversing the state information comparison table corresponding to each process to acquire the network access state information of each process of the target application.
Optionally, the test process is further configured to:
and carrying out system conversion on the opposite terminal address of the network access connection in a state information comparison table corresponding to each process before judging whether each process of the target application has flow leakage according to the network access state information and a preset directional IP address of the target application.
Optionally, the test process is further configured to:
after the target application is started, different application operation instructions are sent to the application process of the target application based on preset application simulation operation corresponding to the target application.
Optionally, the test process is further configured to:
when detecting that the target process of the target application has flow leakage, determining a target application operation instruction which is recently sent to the application process;
and sending the target application operation instruction to the application process again, and monitoring a transport layer data record file corresponding to the target process in the system management directory.
In a third aspect, a test terminal is provided, which includes a processor and a memory, where at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the memory, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the method for detecting traffic leakage of an application according to the first aspect.
In a fourth aspect, there is provided a computer readable storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by a processor to implement the method for traffic leakage detection of an application according to the first aspect.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, a test process receives a flow test instruction aiming at a target application and starts the target application; when the target application is subjected to scene simulation, the test process acquires the network access state information of each process of the target application through the transport layer data recording file corresponding to each process of the target application in the system management directory; and the test process judges whether each process of the target application has flow leakage or not according to the network access state information and a preset directional IP address of the target application. Therefore, the test process accesses the transport layer data record file corresponding to the application process in the system management directory to obtain the network access state information of the application process, a plurality of test devices can be supported to simultaneously perform flow leakage detection, the process with flow leakage can be accurately and visually determined, manual participation is not needed, the time and labor cost of detection is reduced, and the detection efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart of a method for detecting a flow leakage of an application according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a test terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The embodiment of the invention provides a method for detecting flow leakage of an application, which can be applied to a test terminal of the application and is specifically realized by a test process running on the test terminal. The testing terminal can be any network device which is provided with an android operating system and used for detecting the flow leakage condition of the application by a CDN server when the application is in a testing stage, and the CDN server can install a testing tool for performing specific testing on each testing terminal. When it is necessary to detect whether the application has a traffic leakage problem, the CDN service may start the test tool on the test terminal to run a test process, and perform related detection processing through the test process. It can be understood that if the test tools are deployed on multiple test terminals, one or more applications can be simultaneously subjected to the traffic leakage test through the multiple test terminals. The test terminal may include a processor, a memory, and a transceiver, wherein the processor may be configured to perform a process performed by a test procedure in the following process, the memory may be configured to store data required and generated during the following process, and the transceiver may be configured to receive and transmit data related to the following process. It can be understood that all the processes implemented by the test process in the present application can be understood as being specifically implemented by the test terminal running the test process through the test process.
The process flow shown in fig. 1 will be described in detail below with reference to specific embodiments, and the contents may be as follows:
step 101, a test process receives a flow test instruction for a target application, and starts the target application.
The application is an application program that can be run on the terminal, and the target application can be one or a class of application programs.
In implementation, in a development and test stage of a directional flow metering expense function of an application, a CDN service side may perform a flow leakage test on the application through a test terminal. Taking the target application as an example, when detecting whether the target application has a traffic leakage problem, a technician at the CDN service side may first install the target application on the test terminal, then start a test tool pre-deployed on the test terminal, and run a test process. Then, a technician may input a flow test instruction for the target application on the test terminal, thereby triggering the test process to receive the flow test instruction, determining the target application to be tested, and calling a system Intent API to start the target application.
Optionally, after the target application is started, the test process may obtain the relevant process identification information through a shell command, and accordingly, after step 101, the following processing may exist: and the test process executes the shell command, and acquires the process identification information of each process of the target application according to the application identification of the target application.
The process identification information may be information for uniquely marking a process, specifically PID information, or information in other forms, in this embodiment, PID information is uniformly used as an example for description, and information in other forms is similar to the PID information and is not described one by one.
In implementation, after the target application is started, the test process may execute a shell command, and then obtain PID information of each process of the target application according to the application identifier of the target application. The specific shell command may be a "ps | grep" command, and is used to acquire PID information of all processes on the current test terminal, and then an application identifier "packagemame" of the target application is used as a parameter of the "ps | grep" command, that is, the "ps | grep packagemame" is formed, so as to filter out PID information of each process of the target application.
102, when the target application is subjected to scene simulation, the test process obtains the network access state information of each process of the target application through the transport layer data record file corresponding to each process of the target application in the system management directory.
The transport layer data record file may be a transport layer data file for recording a network access connection of a process, and specifically may be a net/tcp file corresponding to tcp connection under ipv4, a net/tcp6 file corresponding to tcp connection under ipv6, a net/udp file corresponding to udp connection under ipv4, or a net/udp6 file corresponding to udp connection under ipv 6. The network access state information may be a connection state (e.g., a connection state or a disconnection state) of a network access connection including a process, quintuple information of the network access connection, and the like.
In implementation, after the target application is started, the system process of the test terminal may create a transport layer data record file corresponding to each process of the target application in a system management directory, and record network access state information of each process through the transport layer data record file. Therefore, when the target application is subjected to the flow leakage test, the target application can be subjected to scene simulation firstly, so that all scenes which may appear when a user uses the target application can be reproduced. And when the scene simulation is carried out on the target application, the network access state information of the process can be recorded in real time in the transmission layer data recording file corresponding to each process of the target application. Furthermore, the test process can obtain the network access state information of each process of the target application through the transport layer data record file corresponding to each process of the target application in the system management directory.
Optionally, based on the process of acquiring the process identification information by the test process, the test process may acquire the network access status information corresponding to the process through the process identification information, and accordingly, the process of acquiring the network access status information in step 102 may be as follows: for a target process of the target application, for the target process of the target application, the test process searches a target file directory named based on process identification information of the target process in a system management directory, and obtains network access state information of the target process through a transport layer data recording file in the target file directory.
In implementation, after the target application is started, the system process of the test terminal may create a plurality of file directories named with PID information of each process of the target application in a system management directory, and create a transport layer data record file for recording network access status information of the corresponding process under each file directory. Thus, taking a target process of a target application as an example, after obtaining PID information of the target process, a test process may first search a target file directory named based on PID information of the target process in a system management directory, and then may obtain network access state information of the target process by accessing a transport layer data record file in the target file directory.
Optionally, the network access state information of the processes may be recorded in a uniform comparison table, and accordingly, the process of acquiring the network access state information of all the processes may specifically be as follows: and the test process periodically traverses the transport layer data record file corresponding to each process of the target application in the system management directory to generate a state information comparison table corresponding to each process. And traversing the state information comparison table corresponding to each process by the test process to acquire the network access state information of each process of the target application.
The state information comparison table at least comprises the connection state of the network access connection of the process and the opposite terminal address.
In implementation, when performing scene simulation on a target application, a test process may periodically traverse a transport layer data record file corresponding to each process of the target application in a system management directory, so as to generate a state information comparison table corresponding to each process of the target application. Each status information lookup table may be named by PID information of each process, where the status information lookup table may at least include a connection status and a peer address of a network access connection of one process of the target application, and specifically refer to the status information lookup table of the process whose PID information is 5533 shown in table 1.
TABLE 1
Figure GDA0002550253370000081
Therefore, the test process can traverse the state information comparison table corresponding to each process to acquire the network access state information of each process of the target application. Therefore, the network access state information of the process of the target application can be clearly and intuitively reflected through the form of the state information comparison table, and the network access state information of the process can be conveniently checked and confirmed by follow-up manual work.
And 103, judging whether each process of the target application has flow leakage or not by the test process according to the network access state information and a preset directional IP address of the target application.
In implementation, after the test process obtains the network access state information of each process of the target application, a preset directional IP address of the target application may be obtained, where the directional IP address may be predetermined by the CDN service provider based on a directional traffic charging service of the target application and configured on each test terminal, and may specifically exist in the form of an IP address table, where the IP address table may use an application identifier of the target application as a table name, and records all directional IP addresses corresponding to known target applications. In this way, the test process can compare the acquired network access state information with the preset directional IP address of the target application, thereby judging whether each process of the target application has traffic leakage. Specifically, when an IP address in an opposite-end address included in the network access state information of a certain process of the target application does not belong to a preset directional IP address of the target application, it may be determined that traffic leakage occurs in the process, and conversely, if the IP address in the opposite-end address is the same as one of the directional IP addresses, it may be determined that traffic leakage does not occur in the process. For example, the IP address IP of the opposite terminal address corresponding to the process A of the target applicationaTo 125.77.130.208, process B corresponds to the IP address IP of the correspondent addressb125.77.120.208, and the preset target application has a directional IP address of 125.77.130.0-125.77.130.255, the IPaBelonging to a directed IP address, IPbAnd the method does not belong to the directional IP address, so that the process A has no flow leakage and the process B has flow leakage. Further, if a process has a traffic leak, the network access status information of the process may be added to the test log of the target application.
Optionally, after the state information comparison table is generated, the opposite-end address of the access connection in the state information comparison table may be converted so as to compare with the directional IP address, and accordingly, the following processing may exist before step 103: and the test process carries out the system conversion on the address of the opposite terminal of the network access connection in the state information comparison table corresponding to each process.
In implementation, after the test process generates a state information comparison table corresponding to the process for each process of the target application, the peer address of the network access connection in the state information comparison table may be extracted. The opposite terminal address of the network access connection can be in a 16-system network byte order form, and in order to facilitate comparison with the directional IP address, the test process can carry out system conversion on the opposite terminal address of the network access connection to generate the opposite terminal address in a decimal point system. Further, the test process may perform subsequent comparisons with the directed IP address based on the dotted decimal counterpart address.
Optionally, the test tool may be configured with a function of performing scene simulation on the application, and accordingly, after the test process starts the target application, the following processing may exist: and the test process simulates operation based on a preset scene corresponding to the target application and sends different application operation instructions to the application process of the target application.
In implementation, when a technician at the CDN service side develops a test tool, a function of performing scene simulation on an application may be added to the test tool, and further, considering that the usage scenes of applications of the same type are substantially the same, a function code of the same scene simulation may be configured for the applications of the same type, for example, for a video playing application, a function of simulating scenes such as video playing, video downloading, and video sharing may be provided, and for an instant messaging application, a function of simulating scenes such as a text session, a voice session, and a video session may be provided. In this way, after the test process starts the target application, the category to which the target application belongs can be determined, and then different application operation instructions are sent to the application process of the target application based on the preset scene simulation operation corresponding to the target application, namely the scene simulation operation in the category, so that the scene simulation of the target application is realized. It should be noted that the sending intervals of different application operation instructions can be adjusted manually according to the needs of the application scenario. Of course, the scene simulation of the target application can also be implemented by manual triggering of a technician or by a combination of a testing process and a human.
Optionally, the application operation instruction is sent based on the test process, so as to implement processing of application scene simulation, when the traffic leakage is detected, the test process may repeatedly simulate the current scene to determine whether the traffic leakage is accidental, and accordingly, the processing of the test process may be as follows: when detecting that the target process of the target application has flow leakage, the test process determines a target application operation instruction which is recently sent to the application process; and the test process sends the target application operation instruction to the application process again and monitors the transport layer data record file corresponding to the target process in the system management directory.
In implementation, when the test process analyzes the network access state information of all processes of the target application, if a process (e.g., the target process) of the target application is found to have traffic leakage, an application usage scenario in which the traffic leakage occurs may be determined, and the application usage scenario is reproduced again. Specifically, the test process may determine the target application operation instruction that is sent to the application process most recently, and then send the target application operation instruction to the application process of the target application again. Then, the test process may monitor only the transport layer data record file corresponding to the target process in the system management directory to obtain the network access state information of the target process, and then further determine whether the target process has a traffic leakage problem according to the network access state information. It is easy to understand that when a process is detected to have a flow leakage problem for the first time, the process needs to be reproduced through N scenes, and whether the process has the flow leakage problem is judged when the scenes are reproduced every time, so that the influence of an accidental event on a detection result can be reduced, and the accuracy of the detection result is ensured to a certain extent.
In the embodiment of the invention, a test process receives a flow test instruction aiming at a target application and starts the target application; when the target application is subjected to scene simulation, the test process acquires the network access state information of each process of the target application through the transport layer data recording file corresponding to each process of the target application in the system management directory; and the test process judges whether each process of the target application has flow leakage or not according to the network access state information and a preset directional IP address of the target application. Therefore, the test process accesses the transport layer data record file corresponding to the application process in the system management directory to obtain the network access state information of the application process, a plurality of test devices can be supported to simultaneously perform flow leakage detection, the process with flow leakage can be accurately and visually determined, manual participation is not needed, the time and labor cost of detection is reduced, and the detection efficiency is improved.
Based on the same technical concept, an embodiment of the present invention further provides a device for detecting a flow leakage of an application, where the device runs a test process, and the test process is configured to:
receiving a flow test instruction aiming at a target application, and starting the target application;
when the target application is subjected to scene simulation, network access state information of each process of the target application is obtained through a transport layer data recording file corresponding to each process of the target application in a system management directory;
and judging whether each process of the target application has flow leakage or not according to the network access state information and a preset directional IP address of the target application.
Optionally, the test process is further configured to:
and after the target application is started, executing a shell command, and acquiring process identification information of each process of the target application according to the application identification of the target application.
Optionally, the test process is specifically configured to:
and for the target process of the target application, searching a target file directory named based on the process identification information of the target process in a system management directory, and acquiring the network access state information of the target process through a transmission layer data record file in the target file directory.
Optionally, the test process is specifically configured to:
periodically traversing a transport layer data record file corresponding to each process of the target application in a system management directory to generate a state information comparison table corresponding to each process, wherein the state information comparison table at least comprises a connection state of network access connection of the process and an opposite terminal address;
and traversing the state information comparison table corresponding to each process to acquire the network access state information of each process of the target application.
Optionally, the test process is further configured to:
and carrying out system conversion on the opposite terminal address of the network access connection in a state information comparison table corresponding to each process before judging whether each process of the target application has flow leakage according to the network access state information and a preset directional IP address of the target application.
Optionally, the test process is further configured to:
after the target application is started, different application operation instructions are sent to the application process of the target application based on preset application simulation operation corresponding to the target application.
Optionally, the test process is further configured to:
when detecting that the target process of the target application has flow leakage, determining a target application operation instruction which is recently sent to the application process;
and sending the target application operation instruction to the application process again, and monitoring a transport layer data record file corresponding to the target process in the system management directory.
In the embodiment of the invention, a test process receives a flow test instruction aiming at a target application and starts the target application; when the target application is subjected to scene simulation, the test process acquires the network access state information of each process of the target application through the transport layer data recording file corresponding to each process of the target application in the system management directory; and the test process judges whether each process of the target application has flow leakage or not according to the network access state information and a preset directional IP address of the target application. Therefore, the test process accesses the transport layer data record file corresponding to the application process in the system management directory to obtain the network access state information of the application process, a plurality of test devices can be supported to simultaneously perform flow leakage detection, the process with flow leakage can be accurately and visually determined, manual participation is not needed, the time and labor cost of detection is reduced, and the detection efficiency is improved.
It should be noted that: in the device for detecting a flow leakage of an application provided in the above embodiment, when detecting a flow leakage of an application, only the division of the above functional modules is used for illustration, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus for detecting flow leakage of an application provided in the foregoing embodiment and the method embodiment for detecting flow leakage of an application belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not described herein again.
Fig. 2 is a schematic structural diagram of a test terminal according to an embodiment of the present invention. The test terminal 200, which may vary widely in configuration or performance, may include one or more central processors 222 (e.g., one or more processors) and memory 232, one or more storage media 230 (e.g., one or more mass storage devices) storing applications 242 or data 244. Memory 232 and storage medium 230 may be, among other things, transient or persistent storage. The program stored in the storage medium 230 may include one or more modules (not shown), each of which may include a series of instructions operating on the test terminal 200. Still further, the central processor 222 may be configured to communicate with the storage medium 230 to execute a series of instruction operations in the storage medium 230 on the test terminal 200.
The test terminal 200 may also include one or more power supplies 229, one or more wired or wireless network interfaces 250, one or more input-output interfaces 258, one or more keyboards 256, and/or one or more operating systems 241, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.
The test terminal 200 may include a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing the above-described traffic leak detection for an application.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (16)

1. A method of traffic leak detection for an application, the method comprising:
a test process receives a flow test instruction aiming at a target application and starts the target application;
when the target application is subjected to scene simulation, the test process acquires the network access state information of each process of the target application through a transport layer data record file corresponding to each process of the target application in a system management directory;
the test process judges whether each process of the target application has flow leakage according to the network access state information and a preset directional IP address of the target application;
when the IP address in the opposite terminal address contained in the network access state information of the process of the target application does not belong to the preset directional IP address of the target application, judging that the flow leakage occurs in the process.
2. The method of claim 1, wherein after the test process starts the target application, further comprising:
and the test process executes the shell command, and acquires the process identification information of each process of the target application according to the application identification of the target application.
3. The method according to claim 2, wherein the obtaining, by the test process, the network access status information of each process of the target application through a transport layer data record file corresponding to each process of the target application in a system management directory comprises:
for the target process of the target application, the test process searches a target file directory named based on the process identification information of the target process in a system management directory, and obtains the network access state information of the target process through a transmission layer data record file in the target file directory.
4. The method according to claim 1, wherein the obtaining, by the test process, the network access status information of each process of the target application through a transport layer data record file corresponding to each process of the target application in a system management directory comprises:
the test process periodically traverses a transport layer data record file corresponding to each process of the target application in a system management directory to generate a state information comparison table corresponding to each process, wherein the state information comparison table at least comprises a connection state of network access connection of the process and an opposite terminal address;
and traversing the state information comparison table corresponding to each process by the test process to acquire the network access state information of each process of the target application.
5. The method according to claim 4, wherein before the testing process determines whether each process of the target application has a traffic leakage according to the network access status information and a preset directional IP address of the target application, the method further comprises:
and the test process carries out the system conversion on the address of the opposite terminal of the network access connection in the state information comparison table corresponding to each process.
6. The method of claim 1, wherein after the test process starts the target application, further comprising:
and the test process sends different application operation instructions to the application process of the target application based on preset application simulation operation corresponding to the target application.
7. The method of claim 6, further comprising:
when detecting that the target process of the target application has flow leakage, the test process determines a target application operation instruction which is recently sent to the application process;
and the test process sends the target application operation instruction to the application process again and monitors the transport layer data record file corresponding to the target process in the system management directory.
8. An apparatus for performing traffic leakage detection on an application, the apparatus running a test process, the test process configured to:
receiving a flow test instruction aiming at a target application, and starting the target application;
when the target application is subjected to scene simulation, network access state information of each process of the target application is obtained through a transport layer data recording file corresponding to each process of the target application in a system management directory;
judging whether each process of the target application has flow leakage or not according to the network access state information and a preset directional IP address of the target application;
when the IP address in the opposite terminal address contained in the network access state information of the process of the target application does not belong to the preset directional IP address of the target application, judging that the flow leakage occurs in the process.
9. The apparatus of claim 8, wherein the test process is further configured to:
and after the target application is started, executing a shell command, and acquiring process identification information of each process of the target application according to the application identification of the target application.
10. The apparatus of claim 9, wherein the test process is specifically configured to:
and for the target process of the target application, searching a target file directory named based on the process identification information of the target process in a system management directory, and acquiring the network access state information of the target process through a transmission layer data record file in the target file directory.
11. The apparatus of claim 8, wherein the test process is specifically configured to:
periodically traversing a transport layer data record file corresponding to each process of the target application in a system management directory to generate a state information comparison table corresponding to each process, wherein the state information comparison table at least comprises a connection state of network access connection of the process and an opposite terminal address;
and traversing the state information comparison table corresponding to each process to acquire the network access state information of each process of the target application.
12. The apparatus of claim 11, wherein the test process is further configured to:
and carrying out system conversion on the opposite terminal address of the network access connection in a state information comparison table corresponding to each process before judging whether each process of the target application has flow leakage according to the network access state information and a preset directional IP address of the target application.
13. The apparatus of claim 8, wherein the test process is further configured to:
after the target application is started, different application operation instructions are sent to the application process of the target application based on preset application simulation operation corresponding to the target application.
14. The apparatus of claim 13, wherein the test process is further configured to:
when detecting that the target process of the target application has flow leakage, determining a target application operation instruction which is recently sent to the application process;
and sending the target application operation instruction to the application process again, and monitoring a transport layer data record file corresponding to the target process in the system management directory.
15. A test terminal comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, set of codes, or set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by the processor to implement the method of traffic leakage detection for an application according to any of claims 1 to 7.
16. A computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement the method of traffic leakage detection for an application according to any of claims 1 to 7.
CN201811555328.4A 2018-12-18 2018-12-18 Method and device for detecting flow leakage of application Expired - Fee Related CN109587643B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811555328.4A CN109587643B (en) 2018-12-18 2018-12-18 Method and device for detecting flow leakage of application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811555328.4A CN109587643B (en) 2018-12-18 2018-12-18 Method and device for detecting flow leakage of application

Publications (2)

Publication Number Publication Date
CN109587643A CN109587643A (en) 2019-04-05
CN109587643B true CN109587643B (en) 2020-11-06

Family

ID=65930048

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811555328.4A Expired - Fee Related CN109587643B (en) 2018-12-18 2018-12-18 Method and device for detecting flow leakage of application

Country Status (1)

Country Link
CN (1) CN109587643B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277502B (en) * 2022-06-17 2023-10-10 广州根链国际网络研究院有限公司 Method for automatically measuring IPv6 flow aiming at APP

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103001814A (en) * 2011-09-09 2013-03-27 湖南神州祥网科技有限公司 Method for describing network flow characteristic statistics
CN103166807A (en) * 2011-12-15 2013-06-19 中国电信股份有限公司 Analyzing and processing method and analyzing and processing system of traffic flow direction based on application
CN103929373A (en) * 2014-03-20 2014-07-16 江苏省未来网络创新研究院 Method for accurately recognizing network application traffic
CN104023092A (en) * 2014-04-29 2014-09-03 中国联合网络通信集团有限公司 Method and system for realizing directed flow packet
CN104348682A (en) * 2014-10-11 2015-02-11 北京中创腾锐技术有限公司 Method and system for mobile application flow feature automatic analysis
CN105988928A (en) * 2015-03-02 2016-10-05 腾讯科技(深圳)有限公司 Terminal application testing method and mobile terminal
CN106302350A (en) * 2015-06-01 2017-01-04 阿里巴巴集团控股有限公司 URL monitoring method, device and equipment
CN108494616A (en) * 2018-02-26 2018-09-04 上海康斐信息技术有限公司 A kind of cell phone application flow rate test method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070130324A1 (en) * 2005-12-05 2007-06-07 Jieming Wang Method for detecting non-responsive applications in a TCP-based network
US8024478B2 (en) * 2007-03-28 2011-09-20 Cisco Technology, Inc. Identifying network path including network proxies

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103001814A (en) * 2011-09-09 2013-03-27 湖南神州祥网科技有限公司 Method for describing network flow characteristic statistics
CN103166807A (en) * 2011-12-15 2013-06-19 中国电信股份有限公司 Analyzing and processing method and analyzing and processing system of traffic flow direction based on application
CN103929373A (en) * 2014-03-20 2014-07-16 江苏省未来网络创新研究院 Method for accurately recognizing network application traffic
CN104023092A (en) * 2014-04-29 2014-09-03 中国联合网络通信集团有限公司 Method and system for realizing directed flow packet
CN104348682A (en) * 2014-10-11 2015-02-11 北京中创腾锐技术有限公司 Method and system for mobile application flow feature automatic analysis
CN105988928A (en) * 2015-03-02 2016-10-05 腾讯科技(深圳)有限公司 Terminal application testing method and mobile terminal
CN106302350A (en) * 2015-06-01 2017-01-04 阿里巴巴集团控股有限公司 URL monitoring method, device and equipment
CN108494616A (en) * 2018-02-26 2018-09-04 上海康斐信息技术有限公司 A kind of cell phone application flow rate test method and system

Also Published As

Publication number Publication date
CN109587643A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
CN105808399B (en) Remote debugging method and device
CN112738791B (en) User information correlation backfill method, device, equipment and medium based on 5G core network
CN109067938B (en) Method and device for testing DNS (Domain name Server)
CN108228444B (en) Test method and device
CN111163067B (en) Safety testing method and device and electronic equipment
CN106161396B (en) A kind of method and device for realizing virtual machine network access control
CN114389792B (en) WEB log NAT (network Address translation) front-back association method and system
CN109587643B (en) Method and device for detecting flow leakage of application
CN112118151A (en) Network speed measuring method, device, system, electronic equipment and storage medium
CN113098852A (en) Log processing method and device
CN107645727B (en) Method and device for testing base station
CN109462589B (en) Method, device and equipment for controlling network access of application program
CN108647139B (en) System test method, device, storage medium and electronic device
CN110688319A (en) Application keep-alive capability test method and related device
CN102395141B (en) Recurrence method and equipment based on consistency testing
WO2021155529A1 (en) Resource deletion method, apparatus, and device, and storage medium
CN110324436B (en) Proxy method and device for transport layer proxy
CN113572751A (en) Network flow analysis system and method
CN109582585A (en) A kind of method and apparatus of detection application traffic leakage
CN112416750A (en) Application program boundary testing method and system
CN105323216A (en) Method and apparatus for transmitting communication links, and terminal
CN111669358A (en) Method and device for processing vrouter network isolation spaces in batch
CN106484589B (en) Port access monitoring method and device
CN111010690B (en) Internet of things MME network element signaling tracking method and device
CN115150298B (en) Virtual gateway testing method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20201106

CF01 Termination of patent right due to non-payment of annual fee