CN112737810B - Network problem processing method, device, mobile terminal and medium - Google Patents
Network problem processing method, device, mobile terminal and medium Download PDFInfo
- Publication number
- CN112737810B CN112737810B CN201911058179.5A CN201911058179A CN112737810B CN 112737810 B CN112737810 B CN 112737810B CN 201911058179 A CN201911058179 A CN 201911058179A CN 112737810 B CN112737810 B CN 112737810B
- Authority
- CN
- China
- Prior art keywords
- network
- network packet
- list
- target
- 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.)
- Active
Links
- 238000003672 processing method Methods 0.000 title abstract description 12
- 238000000034 method Methods 0.000 claims abstract description 62
- 238000012545 processing Methods 0.000 claims abstract description 51
- 238000004458 analytical method Methods 0.000 claims abstract description 30
- 230000004044 response Effects 0.000 claims description 59
- 230000002159 abnormal effect Effects 0.000 claims description 57
- 238000012216 screening Methods 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 8
- 230000008569 process Effects 0.000 description 32
- 238000010586 diagram Methods 0.000 description 14
- 230000006870 function Effects 0.000 description 13
- 238000012544 monitoring process Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 5
- 238000012217 deletion Methods 0.000 description 4
- 230000037430 deletion Effects 0.000 description 4
- 230000000007 visual effect Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000000903 blocking effect Effects 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000008676 import Effects 0.000 description 2
- 238000003780 insertion Methods 0.000 description 2
- 230000037431 insertion Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012800 visualization Methods 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000005316 response function Methods 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/14—Network analysis or design
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The embodiment of the invention discloses a network problem processing method, a device, a terminal and a storage medium, wherein the method comprises the following steps: intercepting a network packet aiming at a target application program, adding mark information to the network packet to obtain the target network packet, updating data stored in a list according to the target network packet, wherein the list is a data structure stored according to a preset sequence, and analyzing and processing network problems existing in the target application program according to the data stored in the list when a network problem analysis request aiming at the target application program is received. By implementing the method, the network packet containing the network data can be acquired without connecting a personal computer, so that the network problem of the application program can be conveniently processed, and the processing efficiency of the network problem of the application program is improved.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing network problems, a mobile terminal, and a medium.
Background
The mobile terminal (mobile phone, tablet computer, etc.) is a general name of an electronic device which has an independent operating system and an independent operating space, can be used by a user to install programs provided by third-party service providers such as software, games, navigation, etc., and can realize wireless network access, like a personal computer. With the popularization of mobile terminals, people increasingly rely on Application programs (APPs, applications) in mobile terminals in activities such as communication, social contact, entertainment and the like, however, in the process of using APPs by users, network problems may occur due to instability of networks or defects of App codes, and therefore, problems occurring in APPs need to be tracked in time.
In general, when an App developer tracks a network problem, the App developer needs to connect to a Personal Computer (PC) in a wired or wireless manner, and use the PC as a network agent to realize visualization and tracking processing of network data on the PC based on transmission and reception of all requests through the PC. However, the method for tracking the network problem based on the PC needs to rely on the PC, and when the App needs to track the network problem and there is no PC around, this scheme cannot be implemented, and the process of connecting the PC is also cumbersome, so the existing processing method for the network problem of the App is inefficient.
Disclosure of Invention
The embodiment of the invention provides a network problem processing method, a network problem processing device, a mobile terminal and a medium, which can be used for conveniently processing the network problem of an application program and improving the processing efficiency of the network problem of the application program.
In a first aspect, an embodiment of the present invention provides a method for processing a network problem, where the method includes:
intercepting a network packet aiming at a target application program, wherein the network packet comprises a network request or a network response, and the network packet carries network data;
adding mark information to the network packet to obtain a target network packet, wherein the mark information is used for indicating the interception state of the target network packet;
updating data stored in a list according to the target network packet, wherein the list is a data structure stored according to a preset sequence, the data stored in the list comprises at least one reference network packet intercepted in history and aiming at the target application program, and each reference network packet comprises mark information added in history;
and when a network problem analysis request aiming at the target application program is received, analyzing and processing the network problem existing in the target application program according to the data stored in the list.
In a second aspect, an embodiment of the present invention provides a network problem processing apparatus, where the apparatus includes:
the system comprises an interception module, a processing module and a display module, wherein the interception module intercepts a network packet aiming at a target application program, the network packet comprises a network request or a network response, and the network packet carries network data;
the adding module is used for adding mark information to the network packet to obtain a target network packet, wherein the mark information is used for indicating the interception state of the target network packet;
the updating module is used for updating data stored in a list according to the target network packet, wherein the list is a data structure stored according to a preset sequence, the data stored in the list comprises at least one reference network packet intercepted in history and aiming at the target application program, and each reference network packet comprises mark information added in history;
and the processing module is used for analyzing and processing the network problems of the target application program according to the data stored in the list when receiving the network problem analysis request aiming at the target application program.
In a third aspect, an embodiment of the present invention provides a mobile terminal, including a processor, an input interface, an output interface, and a memory, where the processor, the input interface, the output interface, and the memory are connected to each other, where the memory is used to store a computer program, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program includes program instructions, which, when executed by a processor, cause the processor to execute the method of the first aspect.
In the embodiment of the invention, the mobile terminal intercepts the network packet aiming at the target application program and adds the mark information to the network packet to obtain the target network packet, the mobile terminal updates the data stored in the list according to the target network packet, and when the network problem analysis request aiming at the target application program is received, the mobile terminal analyzes and processes the network problem of the target application program according to the data stored in the list. By implementing the method, the mobile terminal can acquire the network packet containing the network data without being connected with a personal computer, so that the network problem of the application program can be conveniently processed, and the processing efficiency of the network problem aiming at the application program is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
FIG. 1 is a schematic structural diagram of a network problem processing system according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a network problem processing method according to an embodiment of the present invention;
FIG. 3 is a flow chart illustrating another network problem processing method according to an embodiment of the present invention;
FIG. 4 is a schematic workflow diagram of various threads according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a list data adding process according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating a process of clearing list data according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a network problem handling interface according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a network problem handling interface according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a network problem handling interface according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of a network problem handling interface according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a network problem processing apparatus according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention.
Detailed Description
With the popularization of mobile terminals, people increasingly rely on Application programs (APPs) in mobile terminals in activities such as communication, social contact, entertainment and the like, however, in the process of using APPs by users, network problems may occur due to instability of networks or defects of App codes, for example, after a request is sent in an Application program in a mobile terminal of a user, a response returned by a server needs to be received for a long time or the response of the server cannot be received; for another example, the network speed is lower than expected when the user downloads the resource through the application program in the mobile terminal; as another example, the user sends multiple requests through an application in the mobile terminal but receives only one response, or the user sends a single request through an application in the mobile terminal but receives multiple responses. The above problems all pertain to the network problem of the application program in the mobile terminal.
Related art of the embodiments of the present invention mentions that, in a current solution for processing a network problem of an application program, when tracking the network problem, a developer of the App connects to a Personal Computer (PC) in a wired or wireless manner, and uses the PC as a network proxy to implement visualization and tracking processing on network data on the PC based on that all requests are received and sent by the PC. That is, after the mobile terminal needs to establish network connection with the PC, a developer acquires network data from the PC and further analyzes and processes the network data to analyze the cause of the network problem of the application program. However, the above scheme must establish connection with a PC, the process is complicated, and in the case of no PC around the PC, the network problem occurring in the application program cannot be handled, the processing efficiency is low, in the process of analyzing the network problem, developers also analyze based on visual data, and the PC is only responsible for displaying data and cannot perform intelligent analysis on the data, so the intelligence is low. Therefore, the current network problem handling scheme for application programs has the following problems: (1) the connection with the PC is required, and the process is complicated. (2) If there is no PC in the periphery, the network problem cannot be handled. (3) The network problems need to be analyzed manually, and the intelligence of the mobile terminal is low.
Based on this, the embodiment of the present invention provides a network problem processing method, in which a mobile terminal directly intercepts a request and a received response sent by an application, analyzes the intercepted data based on a preset rule, and displays an analysis result. The method can complete the analysis of the network problems without the participation of a PC. Therefore, compared with the existing network problem analysis scheme aiming at the application program, the network problem processing method provided by the embodiment of the invention has the following advantages: (1) the method and the device are high in convenience, and the network problem of the application program can be analyzed without establishing connection with the PC. (2) The intelligence is high, can realize the automatic analysis to the network problem, promotes analysis efficiency.
Based on the above description, an embodiment of the present invention provides a network problem processing system, please refer to fig. 1, where the network problem processing system includes a mobile terminal and a target server, where the target server establishes a network connection with the mobile terminal, the target server may specifically be a background server of a target application program or a server that needs to interact with an application program, and the target application program is specifically an application program of a network problem to be tested in the mobile terminal. The operation principle of the system shown in fig. 1 generally includes that a target application in a mobile terminal sends a network request to a target service, the mobile terminal intercepts the network request, (that is, the network request can still reach a target server for information in the obtained network request), adds tag information for the network request and records the tag information in a list, the target server generates a corresponding network response according to the received network request and sends the network response to the mobile terminal, the mobile terminal intercepts the network response again, adds tag information for the network response and records the network response in the list, that is, the mobile terminal intercepts all network requests and network responses for the target application and records the network responses in the tag information added record and list, wherein data in the list can be sorted according to a preset rule. When an analysis request aiming at a target application program is received, the network request, the network response and the marking information stored in the list are directly called, and data are intelligently analyzed and processed to obtain the reason causing the network problem. And the mobile terminal adopts independent threads to process in the process of intercepting and analyzing the network data, specifically, the network thread intercepts the network packet aiming at the target application program, the working thread adds mark information to the network packet, the display thread updates the data stored in the list according to the target network packet, and the network thread, the working thread and the display thread are independent.
In summary, the network problem analysis system shown in fig. 1 has at least the following advantages: (1) the convenience is high, directly carries out the interception analysis to the network data of application, need not to be connected with the PC, has promoted the convenience of handling the network problem. (2) The intelligence is high, and the rule can be directly preset and data can be analyzed, so that the manual analysis process is reduced, and the intelligence of the mobile terminal on network data analysis is improved. (3) The processing fluency is high, and each processing step is processed by adopting an independent thread, so that the influence of blocking the network thread on the network performance is avoided.
Based on the description of the embodiment of the network problem processing system, the embodiment of the present invention provides a network problem processing method, which may be applied to the network problem processing system shown in fig. 1, and may be specifically executed by the mobile terminal shown in fig. 1. Referring to fig. 2, the network problem handling process may include the following steps S201 to S203:
s201, the mobile terminal intercepts a network packet aiming at the target application program.
In the embodiment of the invention, the network packet comprises a network request or a network response, and the network packet carries network data. Specifically, the network request may be a network request sent by a target application in the mobile terminal to a target server, and the network response may be a network response sent by the target server to the target application in the mobile terminal according to the received network request. The target application may be any application installed in the mobile terminal, and may be specifically selected by a user operating the mobile terminal. In a specific implementation, the mobile terminal may receive a monitoring mode starting operation input by a user, start an application program monitoring mode according to the operation input by the user, and intercept a network packet for a target application program in the application program monitoring mode. When the mobile terminal intercepts the network packet for the target application program, an independent network thread may be specifically allocated to the mobile terminal, and the network packet for the target application program is intercepted by using the network thread.
It should be noted that, after intercepting the network packet for the target application program, the mobile terminal in the embodiment of the present invention does not block the transmission of the network packet in the network, but only acquires the data in the network packet. Therefore, the target server can interact with the mobile terminal.
S202, the mobile terminal adds mark information to the network packet to obtain a target network packet.
In the embodiment of the present invention, the tag information is used to indicate the interception state of the network packet, and specifically, after the mobile terminal intercepts the network packet, the tag information is further added to the network packet, and the tag information is used to indicate the interception state of the network packet. The mobile terminal can adopt an independent working thread to add marking information to the network packet.
In a specific implementation, the tag information includes at least one of time information, address information and status information, where for a network request, the time information includes a request time of the network request, and if a network response to the network request is received, the time information also includes a response time for the network request; the address information comprises the address of a target server corresponding to the network request, and the state information comprises the response state of the network request, including responded or not responded. For the network response, the time information includes a response time of the network response and a request time of the network request corresponding to the network response, the address information includes an address of a target server corresponding to the network, and the status information includes that the network response is sent by the target server under the condition that the network request is not received or is sent by the target server under the condition that the network request is received. And if the network packet comprises the request time or the response time, the mobile terminal takes the request time or the response time in the network packet as the time information. And if the request time or the response time is not included in the network packet, the time of intercepting the network packet by the mobile terminal is used as the time information.
For example, when a target application in the mobile terminal sends a network request to the a-platform server, the mobile terminal intercepts the network request by using an independent network thread, acquires time information and address information in the network request after interception, and adds label information of "12 hours 32 minutes 02 seconds", "a-platform" and "non-response" to the network request according to the time information and the address information. When the mobile terminal intercepts a network response to the network request, the mobile terminal changes "not responded" in the tag information to "responded", and adds time information of "12 hours, 32 minutes and 05 seconds". And adding tag information for the network response.
In one implementation, after the mobile terminal intercepts the network packet, it may also modify (e.g., format adjustment) data in the network packet, cache resources in the network packet offline, and so on.
S203, the mobile terminal updates the data stored in the list according to the target network packet.
In the embodiment of the invention, the list is a data structure stored according to a preset sequence and supports data insertion, deletion, reading and modification in sequence. The data stored in the list includes at least one reference network packet for the target application program intercepted in history, and each reference network packet includes mark information added in history. Namely, the reference network packet is a network packet intercepted in history, and the network packet is added with marking information by the mobile terminal. And when the mobile terminal intercepts one network packet, the network packet is added with the mark information and then is stored in the list. The mobile terminal can independently update the data stored in the list by adopting the display thread and display the updated list. The data stored in the list includes at least one reference network packet for the target application program intercepted in history, and each reference network packet includes mark information added in history. Namely, the reference network packet is a network packet intercepted in history, and the network packet is added with marking information by the mobile terminal. And when the mobile terminal intercepts one network packet, the network packet is added with the mark information and then is stored in the list.
Specifically, the network packets in the list may be sorted according to a preset sorting rule, where the preset sorting rule may be sorted according to a time sequence. After the mobile terminal acquires the target network packet, time information in the mark information of the target network packet is acquired, a corresponding target position of the target network packet in the list is determined according to the time information, and the mobile terminal adds the target network packet to the target position in the list.
And S204, when a network problem analysis request aiming at the target application program is received, the mobile terminal analyzes and processes the network problem of the target application program according to the data stored in the list.
In the embodiment of the invention, the mobile terminal can receive the network problem analysis request aiming at the target application program input by the user at any time, and when the network problem analysis request aiming at the target application program is received, the mobile terminal can analyze and process the network problem existing in the target application program according to the data stored in the list.
In a specific implementation, the specific manner in which the mobile terminal analyzes and processes the network problem existing in the target application program according to the data stored in the list may be that the mobile terminal detects whether an abnormal network packet exists in at least one network packet containing the tag information stored in the list; and if the abnormal network packet exists in the list, determining that the network problem existing in the target application program is associated with the abnormal network packet, and adding an abnormal mark for the abnormal network packet and displaying the abnormal network packet. Wherein, for any network packet containing tag information stored in the list, any network packet containing tag information is an abnormal network packet if at least one of the following conditions is satisfied, and the conditions include: the response time length in the time information is longer than the preset time length, the destination address in the address information is an unknown address, and the response state in the state information is non-response. The specific determination mode of the response duration may be that, after the mobile terminal obtains the network response corresponding to the network request, the mobile terminal calculates a time difference between the time of the network response and the time before the time of the network request, and determines the time difference as the response duration. The unknown address may be an address which is not stored in a database, wherein address information of all addresses which have been historically accessed by the mobile terminal may be stored in the database. By adopting the mode, the abnormal network packet possibly associated with the network problem of the target application program can be displayed quickly, and developers can analyze and process the network data conveniently.
Further, after determining the abnormal network packet, the mobile terminal may also query, according to the abnormal network packet, a cause and a solution of the network problem for the target application program. Specifically, the database may store historical network problems of the historical records, historical abnormal network packets corresponding to the historical network problems, causes of the historical network problems, and solutions to the historical network problems. After the mobile terminal determines the abnormal network in the list, the mobile terminal can calculate the similarity between the abnormal network packet and the historical abnormal network packet stored in the database, and if the historical abnormal network packet with the similarity larger than the preset similarity is found, the mobile terminal obtains and displays the historical network problem corresponding to the historical abnormal network packet, the reason for causing the historical network problem and the historical network problem solution. The specific calculation method of the similarity may be to calculate the number of the same characters in the abnormal network packet and the historical abnormal network packet, and determine the ratio between the number of the same characters and the total number of characters in the abnormal network packet as the similarity between the abnormal network packet and the historical abnormal network packet.
In the embodiment of the invention, the mobile terminal intercepts the network packet aiming at the target application program and adds the mark information to the network packet to obtain the target network packet, the mobile terminal updates the data stored in the list according to the target network packet, and when the network problem analysis request aiming at the target application program is received, the mobile terminal analyzes and processes the network problem of the target application program according to the data stored in the list. By implementing the method, the mobile terminal can acquire the network packet containing the network data without being connected with a personal computer, so that the network problem of the application program can be conveniently processed, and the processing efficiency of the network problem aiming at the application program is improved.
Based on the description of the embodiment of the network problem processing system, the embodiment of the present invention provides another network problem processing method, which may be applied to the network problem processing system shown in fig. 1, and may be specifically executed by the mobile terminal shown in fig. 1. Referring to fig. 3, the network problem handling process may include the following steps S301 to S303:
s301, the mobile terminal intercepts a network packet aiming at the target application program.
In the embodiment of the invention, the network packet comprises a network request or a network response, and the network packet carries network data. Specifically, the network request may be a network request sent by a target application in the mobile terminal to a target server, and the network response may be a network response sent by the target server to the target application in the mobile terminal according to the received network request. The mobile terminal can receive monitoring mode starting operation input by a user, start an application program monitoring mode according to the input operation, and intercept a network packet aiming at a target application program in the application program monitoring mode.
S302, the mobile terminal adds mark information to the network packet to obtain a target network packet.
In the embodiment of the present invention, the tag information is used to indicate the interception state of the network packet, and specifically, after the mobile terminal intercepts the network packet, the tag information is further added to the network packet, and the tag information is used to indicate the interception state of the network packet. In a specific implementation, the tag information includes at least one of time information, address information, and status information.
S303, the mobile terminal updates the data stored in the list according to the target network packet.
In the embodiment of the invention, the list is a data structure stored according to a preset sequence, and supports the sequential insertion, deletion, reading and modification of data. The data stored in the list includes at least one reference network packet for the target application program intercepted in history, and each reference network packet includes mark information added in history.
Specifically, the mobile terminal manages the network packets by using the list, and when receiving one network packet, the mobile terminal adopts the list storage after adding the mark information, and the thread has the characteristic of string execution naturally, so that the thread safety of reading and writing data can be realized without locking the list, and the sequence of receiving and sending the network packets and the data correctness are ensured. Furthermore, the mobile terminal throws the data managed by the list to the display thread, and the display thread can render the data to the display interface without sequencing, so that the list is updated.
In the specific implementation, a thread for intercepting a network packet for a target application program in the mobile terminal is a network thread, a thread for adding mark information to the network packet is a working thread, a thread for updating data stored in a list according to the target network packet is a display thread, and the network thread, the working thread and the display thread are independent of one another. The mobile terminal adopts different threads to process different analysis steps instead of single thread processing, so that the load of the single thread can be reduced, and the influence of network performance caused by network thread blocking is avoided. As shown in fig. 4, which is a schematic view of a work flow of each thread provided in the embodiment of the present invention, specifically, a network thread receives a network packet and sends the network packet to a work thread, the work thread adds tag information to the received network packet to obtain a target network packet and sends the target network packet to a display thread, and the display thread updates and displays data stored in a list according to the received target network packet. Wherein each thread is independent of the other thread.
In one implementation, a plurality of reference lists may be stored in the mobile terminal, each of the reference lists may be configured to store the network packets to which the tags are added, where the tag information of the network packets stored in each of the reference lists may be different, for example, the plurality of reference lists includes a first list, a second list, a third list, a fourth list and a fifth list, the first list is configured to store all the network packets, the second list is configured to store the network requests, the third list is configured to store the network responses, the fourth list is configured to store the network requests and the network responses interacting with the first target server, and the fifth list is configured to store the network requests and the network responses interacting with the second target server.
After the mobile terminal acquires the target network packet, the mobile terminal acquires the mark information carried in the target network packet; and determining a list corresponding to the target network packet from the at least one reference list according to the marking information, and updating the data stored in the list by the mobile terminal according to the target network packet. Specifically, the mobile terminal may determine a list corresponding to the target network packet according to the time information in the tag information, and if the sixth list is used to store the network packet acquired within the preset time period and the time information of the target network packet is within the preset time period, the mobile terminal adds the target network packet to the sixth list. Or, the mobile terminal may determine a list corresponding to the target network packet according to the address information in the tag information, for example, if the seventh list is used to store the network packet whose address information is "a platform" and the address information of the target network packet is "a platform", the mobile terminal adds the target network packet to the seventh list. Or, the mobile terminal may determine a list corresponding to the target network packet according to the state information in the tag information, and if the eighth list is used to store the network packet whose state information is not responded, and the state information of the target network packet is not responded, the mobile terminal adds the target network packet to the eighth list. It should be noted that the same network packet may be added to multiple reference lists respectively under the condition that the storage condition of the reference lists is satisfied.
As shown in fig. 5, which is a schematic flow diagram of adding data in a list, initial data in the list includes data 1 and data 2 …, and after the mobile terminal acquires a target network packet, the target network packet is stored in the list in the form of N +1 th data, so as to update the data in the list.
S304, detecting whether the memory space occupied by the data stored in the list is larger than a preset threshold value.
In the embodiment of the present invention, after the mobile terminal updates the data stored in the list according to the target network packet, it is further detected whether a memory space occupied by the data stored in the list is greater than a preset threshold, and if so, step 305 is executed. The preset threshold may be preset by a user using the mobile terminal, and different preset thresholds may be preset by the user for different applications.
S305, if yes, the mobile terminal screens out target data meeting preset screening rules from the data stored in the list, and clears the target data.
In the embodiment of the invention, after the memory space occupied by the data stored in the mobile detection list is larger than the preset threshold value, the target data meeting the preset screening rule is screened from the data stored in the list, and the target data is removed.
In one implementation mode, after the mobile terminal determines that the memory space occupied by the data stored in the list is greater than a preset threshold, the current operation mode can be detected, if the memory space occupied by the data stored in the list is greater than the preset threshold, the mobile terminal deletes the data with the storage duration exceeding the preset storage duration in the timely deletion mode, if the memory space occupied by the data exceeds the preset storage duration in the list in the pause interception mode, the mobile terminal pauses to intercept a new network packet, does not update the list, sends prompt information to a user to inquire whether to continue receiving, and if the selection result of the user is received, the mobile terminal adjusts the current operation mode to the timely deletion mode and deletes the data with the storage duration exceeding the preset storage duration.
In an implementation manner, the preset screening rule may be that after a piece of data is added at the tail of the list, the mobile terminal deletes the data at the head of the list, so as to implement real-time update of the data in the list. It should be noted that, for data suspected of having an abnormality in the list, the mobile terminal may not delete the data, and may delete other network data in the list. Further, if the memory space occupied by the abnormal data stored in the list is larger than the preset threshold, the mobile terminal compresses the abnormal data stored in the list, for example, deleting the mark information, the space data, the fixed field data and the like in the abnormal data, and keeping the necessary data in the abnormal data. The smaller the remaining memory space of the mobile terminal is, the less the content stored in the abnormal data packet is.
In an implementation manner, if the preset screening rule includes that the storage duration is longer than the preset duration, the specific manner of screening the target data meeting the preset screening rule from the data stored in the list by the mobile terminal may be that the mobile terminal screens out the target data with the storage duration longer than the preset duration from the data stored in the list; and removes the target data from the list. Or the mobile terminal deletes the network request with the time length being N bits before the ranking in the list data. As shown in fig. 6, a schematic diagram of a data clearing process in a list is shown, where data originally stored in the list includes data 1, data 2 …, and when the mobile terminal determines that a memory space occupied by the class table is greater than a preset threshold, the data 1, data 2, and data 3 are determined as target data to be deleted, and the target data are cleared.
S306, when a network problem analysis request aiming at the target application program is received, the mobile terminal analyzes and processes the network problem of the target application program according to the data stored in the list.
In the embodiment of the invention, the mobile terminal can receive the network problem analysis request aiming at the target application program input by the user at any time, and when the network problem analysis request aiming at the target application program is received, the mobile terminal can analyze and process the network problem existing in the target application program according to the data stored in the list.
In a specific implementation, the specific manner in which the mobile terminal analyzes and processes the network problem existing in the target application program according to the data stored in the list may be that the mobile terminal detects whether an abnormal network packet exists in at least one network packet containing the tag information stored in the list; and if the abnormal network packet exists in the list, determining that the network problem existing in the target application program is associated with the abnormal network packet, and adding an abnormal mark for the abnormal network packet and displaying the abnormal network packet.
In the embodiment of the invention, the mobile terminal intercepts the network packet aiming at the target application program and adds the mark information to the network packet to obtain the target network packet, the mobile terminal updates the data stored in the list according to the target network packet, and when the network problem analysis request aiming at the target application program is received, the mobile terminal analyzes and processes the network problem of the target application program according to the data stored in the list. By implementing the method, the mobile terminal can acquire the network packet containing the network data without being connected with a personal computer, so that the network problem of the application program can be conveniently and rapidly processed, and the processing efficiency of the network problem aiming at the application program is improved.
In an implementation scenario, a mobile terminal receives an application monitoring mode starting operation for a target application program input by a user, and intercepts network packets for the target application program in real time in the mode, as shown in fig. 7, in the application monitoring mode, the mobile terminal displays the number of currently intercepted network packets in real time in a display interface, where the number is 144 in the figure, that is, the mobile terminal currently intercepts 144 network packets, and after the mobile terminal intercepts one network packet, the number of network packets in the display interface is displayed by adding 1, as shown in fig. 8. The user may click on the quantity display area, and after the mobile terminal detects the click operation of the user, a detailed list interface is displayed, where the list includes the stored label information of each network packet and the summary of the data in the network packet, and the summary of the eighth data packet of the first data packet and the second data packet … is specifically shown in the list in fig. 8. For each summary, the user may input a click operation on the summary to obtain detailed network packet information, and as shown in fig. 9, after the user clicks the first data packet, the display interface displays detailed contents in the first data packet. Further, the mobile terminal also provides multiple function options, which is convenient for a user to operate when analyzing network problems, as shown in fig. 10, a functional interface diagram is provided for the mobile terminal, specifically, a display interface provided by the mobile terminal includes a display all function, a display only request function, a display only response function, a filter, a hidden special request, a display additional log, a export log, an export additional log, and a quit monitoring function, where the display all function is used to make the mobile terminal display all data in a list, the display only request function is used to make the mobile terminal display network request data of the list, the display only request function is used to make the mobile terminal display network response data of the list, and the filter function is used to input filter conditions, so that the mobile terminal displays data in the list that meets the filter conditions. The hidden special request function is used for requesting partial data in the list. The display additional log function is used to display the tag information added in the list. The export log function is used to import the data stored in the list into a designated folder. The export append log function is used to import the tag information in the list into the specified folder. The exit monitoring function is used for exiting the monitoring of the target application program.
In the embodiment of the invention, the mobile terminal can perform visual display on the data in the list, so that a user can conveniently obtain the network problem aiming at the target application program according to the content analysis of the visual display.
Based on the description of the foregoing network problem processing method embodiment, the embodiment of the present invention further discloses a network problem processing apparatus, which may be applied to the network problem processing system shown in fig. 1, and specifically, the network problem processing apparatus may be operated in a mobile terminal in the network problem processing system shown in fig. 1. The network problem handling device may be a computer program (including program code) running on the mobile terminal or may be a physical device included in the mobile terminal. The network problem handling device may perform the methods shown in fig. 2-3. Referring to fig. 11, the network problem processing apparatus 110 includes: an interception module 1101, an adding module 1102, an updating module 1103, a processing module 1104, and a clearing module 1105.
An interception module 1101, configured to intercept a network packet for a target application, where the network packet includes a network request or a network response, and the network packet carries network data;
an adding module 1102, configured to add tag information to the network packet to obtain a target network packet, where the tag information is used to indicate an interception state of the target network packet;
an updating module 1103, configured to update, according to the target network packet, data stored in a list, where the list is a data structure stored according to a preset order, where the data stored in the list includes at least one reference network packet intercepted in history and targeted to the target application program, and each reference network packet includes mark information added in history;
and the processing module 1104 is configured to, when a network problem analysis request for the target application program is received, analyze and process a network problem existing in the target application program according to the data stored in the list.
In one implementation manner, the thread intercepting the network packet for the target application is a network thread, the thread adding the tag information to the network packet is a work thread, the thread updating the data stored in the list according to the target network packet is a display thread, and the network thread, the work thread and the display thread are independent of each other.
In one implementation, the tagging information includes time information; the preset sequence includes a time sequence, and the updating module 1103 is specifically configured to:
acquiring time information in the marking information of the target network packet;
determining a corresponding target position of the target network packet in the list according to the time information;
adding the target network packet to the list at the target location.
In an implementation manner, the processing module 1104 is specifically configured to:
detecting whether an abnormal network packet exists in at least one network packet containing marking information stored in the list;
if the abnormal network packet exists in the list, determining that the network problem existing in the target application program is associated with the abnormal network packet, and adding an abnormal mark for the abnormal network packet and displaying the abnormal network packet.
In an implementation manner, the processing module 1104 is specifically configured to:
regarding any network packet containing tag information stored in the list, if at least one of the following conditions is satisfied, the any network packet containing tag information is an abnormal network packet, and the conditions include: the response time length in the time information is longer than the preset time length, the destination address in the address information is an unknown address, and the response state in the state information is non-response.
In an implementation manner, the updating module 1103 is specifically configured to:
acquiring the mark information carried in the target network packet;
determining a list corresponding to the target network packet from at least one reference list according to the marking information;
and executing the operation of updating the data stored in the list according to the target network packet.
In an implementation manner, the clearing module 1105 is specifically configured to:
detecting whether the memory space occupied by the data stored in the list is larger than a preset threshold value or not;
if yes, screening target data meeting the preset screening rule from the data stored in the list, and clearing the target data
In the embodiment of the present invention, an interception module 1101 intercepts a network packet for a target application, an addition module 1102 adds tag information to the network packet to obtain the target network packet, an update module 1103 updates data stored in a list according to the target network packet, and when a network problem analysis request for the target application is received, a processing module 1104 analyzes and processes a network problem existing in the target application according to the data stored in the list. By implementing the method, the mobile terminal can acquire the network packet containing the network data without being connected with a personal computer, so that the network problem of the application program can be conveniently processed, and the processing efficiency of the network problem aiming at the application program is improved.
Fig. 12 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention. As shown in fig. 12, the mobile terminal includes: at least one processor 1201, an input device 1203, an output device 1204, a memory 1205, at least one communication bus 1202. Wherein a communication bus 1202 is used to enable connective communication between these components. The memory 1205 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1205 may also optionally be at least one storage device located remotely from the processor 1201 described previously. Wherein the processor 1201 may be combined with the apparatus described in fig. 11, the memory 1205 stores a set of program codes, and the processor 1201, the input device 1203, and the output device 1204 invoke the program codes stored in the memory 1205 to perform the following operations:
a processor 1201, configured to intercept a network packet for a target application, where the network packet includes a network request or a network response, and the network packet carries network data;
a processor 1201, configured to add tag information to the network packet to obtain a target network packet, where the tag information is used to indicate an interception state of the network packet;
the processor 1201 is configured to update data stored in a list according to the target network packet, where the list is a data structure stored according to a preset order, the data stored in the list includes at least one reference network packet intercepted in history and targeted to the target application program, and each reference network packet includes mark information added in history;
and the processor 1201 is configured to, when a network problem analysis request for the target application program is received, analyze and process a network problem existing in the target application program according to the data stored in the list.
In one implementation manner, the thread intercepting a network packet for a target application is a network thread, the thread adding tag information to the network packet is a working thread, the thread updating data stored in a list according to the target network packet is a display thread, and the network thread, the working thread and the display thread are independent of each other.
In one implementation, the tag information includes time information; the preset sequence includes a time sequence, and the processor 1201 is specifically configured to:
acquiring time information in the marking information of the target network packet;
determining a corresponding target position of the target network packet in the list according to the time information;
adding the target network packet to the list at the target location.
In one implementation, the processor 1201 is specifically configured to:
detecting whether an abnormal network packet exists in at least one network packet containing marking information stored in the list;
if the abnormal network packet exists in the list, determining that the network problem existing in the target application program is associated with the abnormal network packet, and adding an abnormal mark for the abnormal network packet and displaying the abnormal network packet.
In an implementation manner, the processor 1201 is specifically configured to:
for any network packet containing tag information stored in the list, if at least one of the following conditions is satisfied, the any network packet containing tag information is an abnormal network packet, and the conditions include: the response time length in the time information is longer than the preset time length, the destination address in the address information is an unknown address, and the response state in the state information is non-response.
In one implementation, the processor 1201 is specifically configured to:
acquiring the mark information carried in the target network packet;
determining a list corresponding to the target network packet from at least one reference list according to the marking information;
and executing the operation of updating the data stored in the list according to the target network packet.
In one implementation, the processor 1201 is specifically configured to:
detecting whether the memory space occupied by the data stored in the list is larger than a preset threshold value;
and if so, screening target data meeting the preset screening rule from the data stored in the list, and clearing the target data.
In the embodiment of the invention, a processor 1201 intercepts a network packet for a target application program, the processor 1201 adds mark information to the network packet to obtain the target network packet, the processor 1201 updates data stored in a list according to the target network packet, and when a network problem analysis request for the target application program is received, the processor 1201 analyzes and processes a network problem existing in the target application program according to the data stored in the list. By implementing the method, the mobile terminal can acquire the network packet containing the network data without being connected with a personal computer, so that the network problem of the application program can be conveniently processed, and the processing efficiency of the network problem aiming at the application program is improved.
The module in the embodiment of the present invention may be implemented by a general-purpose Integrated Circuit, such as a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit).
It should be understood that, in the embodiment of the present invention, the Processor 1201 may be a Central Processing Unit (CPU), and the Processor may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The bus 1202 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like, and the bus 1202 may be divided into an address bus, a data bus, a control bus, or the like, and fig. 12 illustrates only one bold line for ease of illustration, but does not illustrate only one bus or one type of bus.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. The computer-readable storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.
Claims (10)
1. A method for processing network problems, the method comprising:
intercepting a network packet aiming at a target application program, wherein the network packet comprises a network request or a network response, and the network packet carries network data;
adding mark information to the network packet to obtain a target network packet, wherein the mark information is used for indicating the interception state of the network packet, and the mark information comprises at least one of time information, address information and state information;
updating data stored in a list according to the target network packet, wherein the list is a data structure stored according to a preset sequence, the data stored in the list comprises at least one reference network packet intercepted in history and aiming at the target application program, and each reference network packet comprises mark information added in history;
when a network problem analysis request aiming at the target application program is received, analyzing and processing the network problem existing in the target application program according to the data stored in the list, wherein the analyzing and processing comprises detecting whether an abnormal network packet exists in at least one reference network packet containing marking information stored in the list, and if the abnormal network packet exists in the list, determining that the network problem existing in the target application program is associated with the abnormal network packet.
2. The method according to claim 1, wherein the thread intercepting the network packet for the target application is a network thread, the thread adding the tag information to the network packet is a work thread, the thread updating the data stored in the list according to the target network packet is a display thread, and the network thread, the work thread and the display thread are independent of each other.
3. The method of claim 1, wherein the tag information comprises time information; the preset sequence comprises a time sequence; the updating the data stored in the list according to the target network packet includes:
acquiring time information in the marking information of the target network packet;
determining a corresponding target position of the target network packet in the list according to the time information;
adding the target network packet to the list at the target location.
4. The method according to claim 1, wherein the analyzing and processing the network problem of the target application according to the data stored in the list further comprises:
and adding an abnormal mark for the abnormal network packet and displaying the abnormal network packet.
5. The method according to claim 1, wherein said detecting whether an abnormal network packet exists in at least one network packet containing the tag information stored in the list comprises:
regarding any network packet containing tag information stored in the list, if at least one of the following conditions is satisfied, the any network packet containing tag information is an abnormal network packet, and the conditions include: the response time length in the time information is longer than the preset time length, the destination address in the address information is an unknown address, and the response state in the state information is non-response.
6. The method of claim 1, wherein before updating the data stored in the list according to the target network packet, the method further comprises:
acquiring the mark information carried in the target network packet;
determining a list corresponding to the target network packet from at least one reference list according to the marking information;
and executing the operation of updating the data stored in the list according to the target network packet.
7. The method of claim 1, wherein after updating the data stored in the list according to the target network packet, the method further comprises:
detecting whether the memory space occupied by the data stored in the list is larger than a preset threshold value;
and if so, screening target data meeting the preset screening rule from the data stored in the list, and clearing the target data.
8. A network problem handling apparatus, the apparatus comprising:
the system comprises an interception module, a processing module and a display module, wherein the interception module intercepts a network packet aiming at a target application program, the network packet comprises a network request or a network response, and the network packet carries network data;
the adding module is used for adding mark information to the network packet to obtain a target network packet, wherein the mark information is used for indicating the interception state of the target network packet, and the mark information comprises at least one of time information, address information and state information;
the updating module is used for updating data stored in a list according to the target network packet, wherein the list is a data structure stored according to a preset sequence, the data stored in the list comprises at least one reference network packet intercepted in history and aiming at the target application program, and each reference network packet comprises mark information added in history;
and the processing module is used for analyzing and processing the network problems of the target application program according to the data stored in the list when receiving a network problem analysis request aiming at the target application program, detecting whether an abnormal network packet exists in at least one reference network packet containing the marking information stored in the list, and determining that the network problems of the target application program are associated with the abnormal network packet if the abnormal network packet exists in the list.
9. A mobile terminal, characterized in that it comprises a processor, an input interface, an output interface and a memory, which are interconnected, wherein the memory is used to store a computer program comprising program instructions, and the processor is configured to invoke the program instructions to perform the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to carry out the method according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911058179.5A CN112737810B (en) | 2019-10-29 | 2019-10-29 | Network problem processing method, device, mobile terminal and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911058179.5A CN112737810B (en) | 2019-10-29 | 2019-10-29 | Network problem processing method, device, mobile terminal and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112737810A CN112737810A (en) | 2021-04-30 |
CN112737810B true CN112737810B (en) | 2022-07-12 |
Family
ID=75589061
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911058179.5A Active CN112737810B (en) | 2019-10-29 | 2019-10-29 | Network problem processing method, device, mobile terminal and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112737810B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107295550A (en) * | 2017-06-22 | 2017-10-24 | 广东欧珀移动通信有限公司 | Detection method and device for exception handling function |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10356106B2 (en) * | 2011-07-26 | 2019-07-16 | Palo Alto Networks (Israel Analytics) Ltd. | Detecting anomaly action within a computer network |
US8718644B2 (en) * | 2012-06-08 | 2014-05-06 | Apple Inc. | Automatically modifying wireless network connection policies based on user activity levels |
-
2019
- 2019-10-29 CN CN201911058179.5A patent/CN112737810B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107295550A (en) * | 2017-06-22 | 2017-10-24 | 广东欧珀移动通信有限公司 | Detection method and device for exception handling function |
Also Published As
Publication number | Publication date |
---|---|
CN112737810A (en) | 2021-04-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110519401B (en) | Method, device, equipment and storage medium for improving network access success rate | |
US10481964B2 (en) | Monitoring activity of software development kits using stack trace analysis | |
CN112491602A (en) | Behavior data monitoring method and device, computer equipment and medium | |
CN111143723A (en) | Page jump method and device, electronic equipment and storage medium | |
US10084637B2 (en) | Automatic task tracking | |
CN109547335B (en) | Session message processing method and device | |
CN112671878B (en) | Block chain information subscription method, device, server and storage medium | |
CN103825938A (en) | Method of downloading resources and device | |
CN110232022A (en) | Network environment test method, device and terminal device | |
CN107644075B (en) | Method and device for collecting page information | |
CN111198797B (en) | Operation monitoring method and device and operation analysis method and device | |
CN110177300A (en) | Method, device, electronic device and storage medium for monitoring program running state | |
CN111538922A (en) | Link skip method, application client, device and storage medium | |
CN108337301A (en) | Network request processing method, device, server and the storage medium of application program | |
CN110059064B (en) | Log file processing method and device and computer readable storage medium | |
WO2020259034A1 (en) | Method, apparatus, and device for identifying offline source code, and storage medium | |
CN112737810B (en) | Network problem processing method, device, mobile terminal and medium | |
CN106651183B (en) | Communication data security audit method and device of industrial control system | |
CN111046393B (en) | Vulnerability information uploading method and device, terminal equipment and storage medium | |
CN111343132B (en) | File transmission detection method and device and storage medium | |
CN111124627B (en) | Method and device for determining call initiator of application program, terminal and storage medium | |
CN113626301B (en) | Method and device for generating test script | |
CN115185798A (en) | Data acquisition and analysis method and device, electronic equipment and storage medium | |
CN109327433B (en) | Threat perception method and system based on operation scene analysis | |
CN114239963A (en) | Method and device for detecting directed graph circulation path |
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 |