A network traffic collection method, system and related device for terminal applications
By configuring virtual servers and socket ports on the terminal to directly collect and display network traffic, the problem of complexity and high cost of terminal application traffic monitoring in the existing technology is solved, and efficient traffic collection and monitoring is achieved.
Patent Information
- Application Number
- CN202110422704.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-16
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-04-16
AI Technical Summary
In the existing technology, the network traffic monitoring and collection process of terminal applications requires the installation of a proxy server and the setting of a proxy IP. The cost is high and the operation is cumbersome, making it difficult to achieve efficient traffic monitoring.
By configuring a virtual server on the terminal, use the socket port to receive and parse http protocol data packets, establish a virtual server to feedback network traffic, use Okhttp interceptor, VPN interception or bytecode instrumentation to intercept the traffic, and collect it directly at the terminal and display network traffic.
There is no need for external proxy servers and proxy IPs, and the operation is simple. It significantly improves the network traffic collection efficiency of terminal applications, reduces costs and simplifies the operation process.
Smart Images

Figure CN115242763B
Abstract
Description
Technical Field
[0001] The present application relates to the field of network monitoring, and in particular to a network traffic collection method, system and related devices for terminal applications. Background Art
[0002] In the current process of monitoring and collecting traffic for terminal applications, a proxy server needs to be installed on the PC, and a proxy IP needs to be set on the mobile phone. Through various proxy software and proxy server settings, the network traffic of the mobile phone APP is forwarded through the proxy server, and then the network traffic data is obtained through the proxy software. This is not only costly, but also cumbersome to operate, which is not conducive to the traffic monitoring of terminal applications. Summary of the invention
[0003] The purpose of the present application is to provide a network traffic collection method for terminal applications, a network traffic collection system, a computer-readable storage medium and a terminal, which collect the network traffic of terminal applications by configuring a virtual server in the terminal.
[0004] In order to solve the above technical problems, the present application provides a method for collecting network traffic of terminal applications. The specific technical solution is as follows:
[0005] Receive traffic collection request;
[0006] Enabling a socket port in the terminal application according to the traffic collection request, and configuring a virtual server in the terminal based on the socket port;
[0007] The virtual server is used to feed back the network traffic of the terminal application.
[0008] Optionally, before enabling the socket port according to the traffic collection request, the method further includes:
[0009] The network traffic address of the terminal application is detected, and the socket port is configured for the terminal application according to the network traffic address.
[0010] Optionally, enabling a socket port in the terminal application according to the traffic collection request and configuring a virtual server in the terminal includes:
[0011] enabling a socket port in the terminal application according to the traffic collection request;
[0012] Utilize the socket interface to receive and parse http protocol data packets;
[0013] A software development kit is called according to the parsed data of the http protocol data packet to establish a virtual server.
[0014] Optionally, using the virtual server to feed back the network traffic of the terminal application includes:
[0015] Adopting a preset interception method to intercept the network traffic of the terminal application, wherein the preset interception method includes any one or a combination of any several of adopting an Okhttp interceptor, creating a VPN interception, and bytecode plugging interception;
[0016] A preset browser is used to establish a connection with the virtual server and display the network traffic.
[0017] Optionally, using the virtual server to feed back the network traffic of the terminal application includes:
[0018] Calling a network library interface to collect network traffic of the terminal application;
[0019] A preset browser is used to establish a connection with the virtual server and display the network traffic.
[0020] Optionally, after using the virtual server to feed back the network traffic of the terminal application, the method further includes:
[0021] The virtual server is accessed based on point-to-point communication to obtain the network traffic data.
[0022] Optionally, after using the virtual server to feed back the network traffic of the terminal application, the method further includes:
[0023] The network traffic is stored in a preset memory queue; the preset memory queue is a memory queue generated by a software development kit.
[0024] The present application also provides a network traffic collection system for terminal applications, including:
[0025] A request receiving module, used for receiving a traffic collection request;
[0026] A virtual server generation module, used to enable the socket port in the terminal application according to the traffic collection request, and configure a virtual server in the terminal;
[0027] The flow collection module is used to use the virtual server to feed back the network flow of the terminal application; the virtual server is used for the browser to access and display the network flow.
[0028] The present application also provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above-mentioned method when executed by a processor.
[0029] The present application also provides a terminal, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above method when calling the computer program in the memory.
[0030] The present application provides a method for collecting network traffic of terminal applications, comprising: receiving a traffic collection request; enabling a socket port in the terminal application according to the traffic collection request, and configuring a virtual server in the terminal; using the virtual server to feed back the network traffic of the terminal application; and using the virtual server for a browser to access and display the network traffic.
[0031] When collecting traffic from terminal applications, the present application generates a virtual server in the terminal by enabling the socket port in the terminal application, which is used to feed back the collected network traffic of the terminal application with the help of the virtual server contained in the terminal itself. There is no need to use a proxy server of an external device, nor to configure a proxy IP in the terminal. The operation is simple and can significantly improve the efficiency of collecting network traffic from terminal applications.
[0032] The present application also provides a network traffic collection system for terminal applications, a computer-readable storage medium and a terminal, which have the above-mentioned beneficial effects and are not described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0034] Figure 1 A flowchart of a method for collecting network traffic of a terminal application provided in an embodiment of the present application;
[0035] Figure 2 A flowchart of another method for collecting network traffic of a terminal application provided in an embodiment of the present application;
[0036] Figure 3 A schematic diagram of the structure of a network traffic collection system for a terminal application provided in an embodiment of the present application;
[0037] Figure 4 A structural diagram of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0039] Please refer to Figure 1 , Figure 1 A flowchart of a method for collecting network traffic of a terminal application provided in an embodiment of the present application, the method comprising:
[0040] S101: receiving a traffic collection request;
[0041] This embodiment can be applied to a terminal, which is mainly a mobile terminal, such as a mobile phone and a tablet computer, etc. Of course, it can also be applied to other terminals, which are not limited by examples one by one here. This step is intended to receive a traffic collection request, and there is no specific limitation on how to receive the traffic collection request. The traffic collection request can be generated by the communication method contained in the terminal itself, such as a cellular network, Bluetooth, infrared, etc., or directly by the user through the terminal operation. For example, the user uses the visual touch screen of the terminal to initiate a traffic collection request, which can be used as the source of the traffic collection request. In addition, this embodiment does not limit the specific content of the traffic collection request, which can include the application name of the terminal application for which the traffic needs to be collected, and the relevant parameters of the traffic collection, such as the collection duration, or the collection frequency, etc. It is easy to understand that traffic collection is usually used for traffic collection analysis within a certain time period, or for comparative analysis of network traffic collection with a certain specific time period, for parsing the network traffic data of the terminal application. Therefore, the traffic collection request can include multiple collection time periods, and can also include several terminal applications. Of course, if the traffic collection request is for no less than two terminal applications, the operation process performed below can be performed for each terminal application, or it can be performed only once. The specific number of executions should depend on the setting process of the socket port below.
[0042] S102: enabling a socket port in the terminal application according to the traffic collection request, and configuring a virtual server in the terminal based on the socket port;
[0043] This step is to enable the socket port in the terminal application, which is mainly used to connect the application process and the network protocol stack. When the socket port is enabled, the virtual server can be configured in the terminal. In other words, the purpose of this step is to configure a virtual server inside the terminal. The so-called virtual server is located inside the terminal and does not have the physical hardware of the server, but can play some of the functions of the server.
[0044] This embodiment defaults to configuring the socket port before executing this step. However, there is no specific limitation on how to configure the socket port. The network flow address of the terminal application can be detected, and the socket port can be configured for the terminal application according to the network flow address. It should be noted that the socket port can have a binding relationship with the terminal application, that is, the virtual server configured after the socket port is enabled can detect the terminal application or part of the application containing the terminal application in a targeted manner. It is also possible not to bind with the terminal application, but only operate for the terminal, that is, when the socket port is enabled, the virtual server configured based on the socket port can collect network flow for all applications on the terminal. Of course, the specific relationship between the socket port and the terminal application can be configured accordingly by those skilled in the art according to the needs of flow collection. For example, a separate socket port configuration can be performed for each terminal application that needs to collect network flow, or only one socket port can be configured for the terminal, so that the configured virtual server can feedback the network flow of all terminal applications, and a socket port can also be configured for some terminal applications, and the remaining terminal applications can configure socket ports respectively. The specific configuration process of the socket port can be adaptively changed by those skilled in the art, and all should be within the protection scope of this application.
[0045] However, it should be noted that this application does not limit the execution order between configuring the socket port and receiving the flow collection request in step S101, and only requires that the configuration of the socket port has been completed before executing this step. Of course, in order to improve the efficiency of network flow collection, the socket port can usually be configured for the terminal application in advance, so that this step can be directly executed after receiving the flow collection request, so as to achieve a rapid response to the flow collection request, thereby improving the collection efficiency of network flow.
[0046] There is no specific limitation on how to configure the virtual server after the socket port is enabled. Those skilled in the art can perform protocol processing on the http protocol according to the corresponding configuration of the socket port, thereby realizing the configuration of the virtual server.
[0047] S103: Using the virtual server to feed back the network traffic of the terminal application.
[0048] This step aims to use the virtual server to feedback the network traffic of the terminal application. Its essence is to display the network traffic through the terminal's own virtual server. The display process usually relies on network traffic display tools such as browsers. In this process, the virtual server plays a role in the transfer of network traffic. The specific content of the collected network traffic is not limited here. It can include any data of the terminal application when performing network communication, for example, it can include the uplink data, downlink data, Headers (uplink and downlink message headers of network requests) and network time consumption of the terminal application. Since the virtual server has been configured in the previous step, this step can directly use the virtual server to feedback the network traffic.
[0049] There is no specific limitation on how to collect network traffic. When collecting network traffic, it can be divided into active collection and passive collection. In passive collection, the network traffic of the terminal application can be collected by a preset interception method. The preset interception method includes using an Okhttp interceptor, creating a VPN (Virtual Private Network) interception, and bytecode plug-in interception. Any one or a combination of several items, that is, the network traffic of the terminal application is obtained by interception. In active collection, the network library interface or other interfaces can be used to obtain the network traffic of the terminal application.
[0050] As a preferred execution process of this embodiment, the virtual server can also perform format processing on the collected network traffic to achieve formatting of the network traffic. Since the collected network traffic is usually disorganized and affects the user's identification and viewing, the virtual server can perform format processing on the collected network traffic so as to display the network traffic in a formatted manner. Of course, no limitation is made here on the specific format processing. It should be noted that the format processing is usually used for format normalization between network traffic data, and the data format of the network traffic itself is not limited. If there is a need for format conversion, the format conversion of the network traffic can also be performed through the virtual server.
[0051] In addition, this embodiment does not limit the storage method and storage location of network traffic after collection, and the network traffic can be stored in a preset memory queue, which can be a memory queue generated by a software development kit or other memory queues. When the preset memory queue does not belong to the terminal's own memory, the impact of network traffic collection on terminal performance can be significantly reduced.
[0052] It is particularly important to note that, in view of the current situation that encrypted traffic may be obtained by obtaining network traffic through a proxy server, this embodiment configures a virtual server in the terminal, and can directly obtain the network traffic of the terminal application through the terminal's virtual server, and can even obtain the network traffic and the corresponding encryption key through shared memory, that is, it can be obtained when the network traffic is generated inside the terminal application, rather than obtaining the network traffic sent by the terminal application, which can avoid the network traffic obtained from being encrypted and unable to be parsed without a key. The network traffic obtained through this embodiment can also obtain the encryption key used by the terminal application in the encryption process in real time, so as to effectively decrypt the network traffic.
[0053] When collecting traffic from terminal applications, the embodiment of the present application generates a virtual server in the terminal by enabling the socket port in the terminal application, which is used to feed back the collected network traffic of the terminal application with the help of the virtual server contained in the terminal itself. There is no need to use a proxy server of an external device, nor is there a need to configure a proxy IP in the terminal. The operation is simple and can significantly improve the efficiency of collecting network traffic from terminal applications.
[0054] Based on the above embodiment, this embodiment further describes in detail the configuration process of the virtual server, and the process can be as follows:
[0055] S1021: enabling a socket port in the terminal application according to the traffic collection request;
[0056] S1022: Receive and parse the http protocol data packet using the socket interface;
[0057] S1023: Calling a software development kit to establish a virtual server according to the data of the parsed http protocol data packet.
[0058] After starting the socket port, the socket port is used to receive and parse the http protocol data packet, and the software development kit is called to establish a virtual server. The software development kit is SDK (Software Development Kit), which usually integrates several software or tools. The server-related SDK can be used to implement the configuration of the virtual server. When configuring the virtual server, an httpserver is created according to the parsed http protocol data packet, and a connection is established with the socket port, and the input and output connections between the socket server and the socket port are configured. Combined with the software services integrated in the software development kit, it is used to realize the collection of network traffic by the virtual server, and can also be used for the transmission of network traffic.
[0059] At this time, the corresponding execution process of this embodiment is as follows Figure 2 As shown, Figure 2A flowchart of another method for collecting network traffic of a terminal application provided in an embodiment of the present application, the process of which is as follows:
[0060] S201: receiving a traffic collection request;
[0061] S202: enabling a socket port in a terminal application according to a traffic collection request;
[0062] S203: Receive and parse the http protocol data packet using the socket interface;
[0063] S204: Calling a software development kit to establish a virtual server according to the data of the parsed http protocol data packet.
[0064] S205: Using the virtual server to feed back the network traffic of the terminal application.
[0065] Compared with the previous embodiment, the virtual server configuration process provided in this embodiment can realize the rapid generation of virtual servers by calling the software development kit, thereby helping to improve the collection efficiency of network traffic.
[0066] Based on any of the above embodiments, as a more preferred embodiment of the present application, after the network traffic of the terminal application is collected by using the virtual server, the network traffic can also be displayed. At this time, the network traffic address corresponding to the terminal application can be input through the browser to realize real-time viewing of the network traffic. The browser can be a terminal containing the terminal application or other external terminal devices, such as a PC, a mobile phone, a PAD (portable android device, tablet computer), etc.
[0067] In addition, when displaying network traffic, the format of the network traffic can be adjusted with the help of a software development kit, thereby changing it to a network traffic format that can be recognized by users, such as a json format.
[0068] Furthermore, it is also possible to access the virtual server based on point-to-point communication to obtain network traffic data. Point-to-point communication is P2P (peer-to-peer) communication, which can realize the display process of terminal application traffic on the remote terminal with the help of point-to-point communication. Of course, other technologies can also be used to achieve access to the virtual server, such as terminal traffic sharing display in the local area network, etc., which should all be within the scope of protection of this application.
[0069] The following is an explanation of a preferred specific application process of the present application. If the following actual application process of the present application is adopted, the corresponding socket port should be configured for the terminal application first, and the enable switch of the socket interface can be configured in the terminal application. When the present application actually collects network traffic, the process can be as follows:
[0070] Step 1: The user opens the terminal application and enables the socket port in the terminal application;
[0071] Step 2: After detecting that the socket port is enabled, the terminal receives and parses the http protocol, thereby configuring and generating a virtual server in the terminal;
[0072] Step 3: If active collection is used, the network traffic of the terminal application can be obtained through the network library interface; if passive collection is used, any of the following can be used: Okhttp interceptor, VPN interception, and bytecode instrumentation interception.
[0073] Step 4: Store the collected network traffic into the memory queue;
[0074] Step 5. Enter the network traffic address corresponding to the socket port in the terminal's browser and establish a connection with the virtual server inside the terminal. You can then view the network traffic corresponding to the terminal application, including network uplink and downlink data and logs, etc.
[0075] Of course, in the fifth step, you can also enter the network traffic address in the browser of any other terminal and view the network traffic. In order to facilitate the viewing process of other terminals, you can also configure the terminal where the terminal application is located and other terminals to be in the same local area network, and view the network traffic in the local area network environment, so that the viewing process of network traffic is not affected by external network factors, and the network traffic transmission speed is higher.
[0076] The following is an introduction to a network traffic collection system for terminal applications provided in an embodiment of the present application. The network traffic collection system described below and the network traffic collection method for terminal applications described above can be referenced to each other.
[0077] Figure 3 This is a schematic diagram of the structure of a network traffic collection system for a terminal application provided in an embodiment of the present application. The present application also provides a network traffic collection system for a terminal application, including:
[0078] A request receiving module 100, used to receive a traffic collection request;
[0079] A virtual server generation module 200, configured to enable the socket port in the terminal application according to the traffic collection request and configure a virtual server in the terminal;
[0080] The traffic collection module 300 is used to use the virtual server to feed back the network traffic of the terminal application; the virtual server is used for the browser to access and display the network traffic.
[0081] Based on the above embodiment, as a preferred embodiment, the network traffic collection system may further include:
[0082] The socket port configuration module is used to detect the network traffic address of the terminal application and configure the socket port for the terminal application according to the network traffic address.
[0083] Based on the above embodiment, as a preferred embodiment, the virtual server generation module 200 may include:
[0084] A port enabling unit, configured to enable a socket port in the terminal application according to the traffic collection request;
[0085] A protocol parsing unit, used for receiving and parsing HTTP protocol data packets using the socket interface;
[0086] The server building unit is used to call a software development kit to build a virtual server according to the parsed data of the http protocol data packet.
[0087] Based on the above embodiments, as a preferred embodiment, the traffic collection module is a module used to intercept the network traffic of the terminal application using a preset interception method, establish a connection with the virtual server using a preset browser and display the network traffic; the preset interception method includes using any one or a combination of any several of the Okhttp interceptor, creating a VPN interception and bytecode insertion interception.
[0088] Based on the above embodiments, as a preferred embodiment, the traffic collection module is a module that calls a network library interface to collect the network traffic of the terminal application; uses a preset browser to establish a connection with the virtual server and displays the network traffic.
[0089] Based on the above embodiments, as a preferred embodiment, the following may also be included:
[0090] The traffic acquisition module is used to access the virtual server based on point-to-point communication to obtain the network traffic data.
[0091] Based on the above embodiments, as a preferred embodiment, the following may also be included:
[0092] The storage module is used to store the network traffic in a preset memory queue; the preset memory queue is a memory queue generated by a software development kit.
[0093] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0094] This application also provides a terminal, see Figure 4 , a structural diagram of a terminal provided in an embodiment of the present application, such as Figure 4 As shown, a processor 1410 and a memory 1420 may be included.
[0095] Among them, the processor 1410 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1410 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1410 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1410 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1410 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0096] The memory 1420 may include one or more computer-readable storage media, which may be non-transitory. The memory 1420 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 1420 is at least used to store the following computer program 1421, wherein, after the computer program is loaded and executed by the processor 1410, it can implement the relevant steps in the network traffic collection method of the terminal application disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 1420 may also include an operating system 1422 and data 1423, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 1422 may include Windows, Linux, Android, etc.
[0097] In some embodiments, the terminal may further include a display screen 1430 , an input / output interface 1440 , a communication interface 1450 , a sensor 1460 , a power supply 1470 , and a communication bus 1480 .
[0098] certainly, Figure 4 The structure of the terminal shown does not constitute a limitation on the terminal in the embodiment of the present application. In actual applications, the terminal may include Figure 4 More or fewer components than shown, or combinations of certain components.
[0099] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the system provided in the embodiment, since it corresponds to the method provided in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0100] Specific examples are used herein to illustrate the principles and implementation methods of the present application, and the description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
[0101] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A method for collecting network traffic of terminal applications, characterized in that: include: Receive traffic collection request; Enabling a socket port in the terminal application according to the traffic collection request, and configuring a virtual server in the terminal based on the socket port; Feedback the network traffic of the terminal application by using the virtual server; Among them, enabling the socket port in the terminal application according to the traffic collection request and configuring the virtual server in the terminal includes: enabling a socket port in the terminal application according to the traffic collection request; Utilize the socket interface to receive and parse http protocol data packets; A software development kit is called according to the parsed data of the http protocol data packet to establish a virtual server.
2. The network traffic collection method according to claim 1, characterized in that: Before enabling the socket port according to the traffic collection request, the method further includes: The network traffic address of the terminal application is detected, and the socket port is configured for the terminal application according to the network traffic address.
3. The network traffic collection method according to claim 1, characterized in that: Feedback of the network traffic of the terminal application by using the virtual server includes: Adopting a preset interception method to intercept the network traffic of the terminal application, wherein the preset interception method includes any one or a combination of any several of adopting an Okhttp interceptor, creating a VPN interception, and bytecode plugging interception; A preset browser is used to establish a connection with the virtual server and display the network traffic.
4. The network traffic collection method according to claim 1, characterized in that: Feedback of the network traffic of the terminal application by using the virtual server includes: Calling a network library interface to collect network traffic of the terminal application; A preset browser is used to establish a connection with the virtual server and display the network traffic.
5. The network traffic collection method according to claim 1, characterized in that: After the network traffic of the terminal application is fed back by the virtual server, the method further includes: The virtual server is accessed based on point-to-point communication to obtain the network traffic data.
6. The network traffic collection method according to claim 1, characterized in that: After the network traffic of the terminal application is fed back by the virtual server, the method further includes: The network traffic is stored in a preset memory queue; the preset memory queue is a memory queue generated by a software development kit.
7. A network traffic collection system for terminal applications, characterized in that: include: A request receiving module, used for receiving a traffic collection request; A virtual server generation module, used to enable the socket port in the terminal application according to the traffic collection request, and configure a virtual server in the terminal; A traffic collection module, used to use the virtual server to feed back the network traffic of the terminal application; The virtual server is used for a browser to access and display the network traffic; Wherein, the virtual server generation module includes: A port enabling unit, configured to enable a socket port in the terminal application according to the traffic collection request; A protocol parsing unit, used for receiving and parsing HTTP protocol data packets using the socket interface; The server building unit is used to call a software development kit to build a virtual server according to the parsed data of the http protocol data packet.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for collecting network traffic of a terminal application as described in any one of claims 1 to 6 are implemented.
9. A terminal, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program, and when the processor calls the computer program in the memory, the steps of the network traffic collection method for terminal applications as described in any one of claims 1 to 6 are implemented.
