Search

CN-122001792-A - Network traffic monitoring method, device, equipment and storage medium

CN122001792ACN 122001792 ACN122001792 ACN 122001792ACN-122001792-A

Abstract

The disclosure provides a method, a device, equipment and a storage medium for monitoring network traffic, which relate to the technical field of computers, in particular to the fields of artificial intelligence, cloud computing, mobile application performance monitoring and the like. The method comprises the steps of collecting original network flow data, capturing service context information, correlating the service context information with the original network flow data in real time to obtain a structured flow log, and monitoring network flow according to the structured flow log to obtain a monitoring result.

Inventors

  • Hu Enning

Assignees

  • 北京百度网讯科技有限公司

Dates

Publication Date
20260508
Application Date
20260123

Claims (20)

  1. 1. A monitoring method of network traffic is applied to the inside of an iOS client, and the method comprises the following steps: Collecting original network flow data; Capturing service context information; the service context information is associated with the original network flow data in real time to obtain a structured flow log; And monitoring the network flow according to the structured flow log to obtain a monitoring result.
  2. 2. The method of claim 1, wherein the monitoring network traffic according to the structured traffic log, to obtain a monitoring result, includes: Carrying out local aggregation on the structured flow log to obtain an aggregation report; Reporting the aggregation report to a cloud server for analysis according to a reporting strategy; And monitoring the network flow according to the analysis report returned by the cloud server to obtain the monitoring result.
  3. 3. The method of claim 2, wherein the collecting raw network traffic data comprises: Intercepting the network request initiated by the iOS client and the received network response to obtain the original network traffic data.
  4. 4. The method of claim 3, wherein the network request and received network response comprise the network request and received network response intercepted by an application layer and the network request and received network response intercepted by a session layer.
  5. 5. The method of claim 3 or 4, wherein the capturing traffic context information comprises: Capturing a current operation page and operation information; and obtaining the service context information according to the current operation page and the operation information.
  6. 6. The method according to claim 3 or 4, wherein said correlating said traffic context information with said original network traffic data in real time to obtain a structured traffic log, comprises: Tracking the operation state of at least one operation page to obtain the service context information at least comprising the current operation page and operation information; and carrying out real-time association on the service context information and the original network flow data to obtain the structured flow log carrying the associated service label.
  7. 7. The method of any of claims 2-6, wherein the locally aggregating the structured traffic log to obtain an aggregate report comprises: And carrying out local aggregation on the structured flow log according to a local preset aggregation dimension to obtain the aggregation report.
  8. 8. The method of claim 7, wherein the aggregated dimensions comprise at least one of a business scenario dimension, an interface dimension, and a user dimension.
  9. 9. A software development kit SDK comprising a method of monitoring network traffic as implemented in any one of the preceding claims 1-8.
  10. 10. An iOS client comprising a method of monitoring network traffic as implemented in any of the preceding claims 1-8.
  11. 11. A monitoring device for network traffic integrated within an iOS client, the device comprising: the acquisition module is used for acquiring the original network flow data; the context capturing module is used for capturing service context information; The association module is used for carrying out real-time association on the service context information and the original network flow data so as to obtain a structured flow log; And the monitoring module is used for monitoring the network flow according to the structured flow log to obtain a monitoring result.
  12. 12. The apparatus of claim 11, wherein the monitoring module comprises: the local aggregation unit is used for locally aggregating the structured flow logs to obtain an aggregation report; The reporting unit is used for reporting the aggregation report to a cloud server for analysis according to a reporting strategy; And the flow monitoring unit is used for monitoring the network flow according to the analysis report returned by the cloud server to obtain the monitoring result.
  13. 13. The apparatus of claim 12, wherein the means for intercepting the iOS client initiated network request and the received network response to obtain the raw network traffic data.
  14. 14. The apparatus of claim 13, wherein the network requests and received network responses comprise the network requests and received network responses intercepted by an application layer and the network requests and received network responses intercepted by a session layer.
  15. 15. The apparatus of claim 13 or 14, wherein the context capture module comprises: The information capturing unit is used for capturing a current operation page and operation information; And the information determining unit is used for obtaining the service context information according to the current operation page and the operation information.
  16. 16. The apparatus of claim 13 or 14, wherein the association module comprises: The tracking unit is used for tracking the operation state of at least one operation page and obtaining the business context information at least comprising the current operation page and the operation information; And the association unit is used for carrying out real-time association on the service context information and the original network flow data to obtain the structured flow log carrying the associated service label.
  17. 17. The apparatus according to any one of claims 12-16, wherein the local aggregation unit is configured to locally aggregate the structured traffic log according to a locally preset aggregation dimension, to obtain the aggregation report.
  18. 18. The apparatus of claim 17, wherein the aggregated dimensions comprise at least one of a business scenario dimension, an interface dimension, and a user dimension.
  19. 19. A mobile terminal comprising a network traffic monitoring device according to any of the preceding claims 11-18.
  20. 20. An electronic device, comprising: At least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.

Description

Network traffic monitoring method, device, equipment and storage medium Technical Field The present disclosure relates to the field of computer technologies, and in particular, to the fields of artificial intelligence, cloud computing, mobile application performance monitoring, and the like. Background The current flow monitoring of the iOS application mainly depends on a limited system interface provided by an apple company, or a developer only manually packages a network request library at an application layer, and adds up byte numbers when the request is initiated and completed, and the network flow monitoring mode has at least the obvious defect that the specific service from which the network flow comes cannot be distinguished. Disclosure of Invention The disclosure provides a method, a device, equipment and a storage medium for monitoring network traffic. According to an aspect of the present disclosure, there is provided a method for monitoring network traffic, applied inside an iOS client, the method including: Collecting original network flow data; Capturing service context information; the service context information is associated with the original network flow data in real time to obtain a structured flow log; And monitoring the network flow according to the structured flow log to obtain a monitoring result. According to another aspect of the present disclosure, there is provided a software development kit (SDK, software Development Kit) comprising a method as provided by any one of the embodiments of the present disclosure. According to another aspect of the present disclosure, there is provided an iOS client comprising a method as provided by any one of the embodiments of the present disclosure. According to another aspect of the present disclosure, there is provided a monitoring apparatus for network traffic, integrated inside an iOS client, the apparatus comprising: the data acquisition module is used for acquiring the original network flow data; the context capturing module is used for capturing service context information; the data association module is used for carrying out real-time association on the service context information and the original network flow data so as to obtain a structured flow log; And the monitoring module is used for monitoring the network flow according to the structured flow log to obtain a monitoring result. According to another aspect of the present disclosure, there is provided an electronic device including: At least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods provided by any one of the embodiments of the present disclosure. According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform a method provided according to any one of the embodiments of the present disclosure. According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method provided according to any of the embodiments of the present disclosure. It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification. Drawings The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein: FIG. 1 is a schematic diagram of a distributed cluster processing scenario according to an embodiment of the present disclosure; Fig. 2 is a flow chart of a method of monitoring network traffic according to an embodiment of the present disclosure; FIG. 3 is a flow chart of another method of monitoring network traffic according to an embodiment of the present disclosure; FIG. 4 is a flow chart of another method of monitoring network traffic according to an embodiment of the present disclosure; Fig. 5 is a schematic structural diagram of a monitoring device for network traffic in an application example according to an embodiment of the present disclosure; FIG. 6 is a workflow diagram for background optimization using network traffic monitoring in an application example in accordance with an embodiment of the present disclosure; fig. 7 is a schematic structural diagram of a monitoring device for network traffic according to an embodiment of the present disclosure; fig. 8 is a block diagram of an electronic device for implementing a method of monitoring network traffic in accordance with an embodiment of the present disclosure. Detailed Description Exemplary embodiments of the present dis