CN115086424B - Method, device, terminal equipment and storage medium for monitoring network request - Google Patents

Method, device, terminal equipment and storage medium for monitoring network request Download PDF

Info

Publication number
CN115086424B
CN115086424B CN202210745222.0A CN202210745222A CN115086424B CN 115086424 B CN115086424 B CN 115086424B CN 202210745222 A CN202210745222 A CN 202210745222A CN 115086424 B CN115086424 B CN 115086424B
Authority
CN
China
Prior art keywords
network request
network
library
information
request
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
Application number
CN202210745222.0A
Other languages
Chinese (zh)
Other versions
CN115086424A (en
Inventor
张一天
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Shareit Information Technology Co Ltd
Original Assignee
Beijing Shareit Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Shareit Information Technology Co Ltd filed Critical Beijing Shareit Information Technology Co Ltd
Priority to CN202210745222.0A priority Critical patent/CN115086424B/en
Publication of CN115086424A publication Critical patent/CN115086424A/en
Application granted granted Critical
Publication of CN115086424B publication Critical patent/CN115086424B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1014Server selection for load balancing based on the content of a request

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The disclosure provides a method, a device, terminal equipment and a storage medium for monitoring a network request. The method comprises the following steps: acquiring a plurality of network request libraries, wherein the plurality of network request libraries comprise a plurality of network request modes; converting the multiple network request modes into a preset network request mode to obtain an updated preset network request library; and setting a network monitor for the updated preset network request library, wherein the network monitor is used for monitoring the network request of the target user. In the method, the request modes of the plurality of network request libraries can be converted into the preset network request mode, and the network monitors are uniformly arranged on the updated network request libraries, so that the network requests are monitored, the network monitoring efficiency is improved, and the running speed of the terminal is guaranteed.

Description

Method, device, terminal equipment and storage medium for monitoring network request
Technical Field
The disclosure relates to the technical field of network requests, and in particular relates to a method, a device, terminal equipment and a storage medium for monitoring a network request.
Background
Networks, such as social applications, video applications, shopping applications, etc., are currently used in Android applications. In practice, many software products require network requests to execute corresponding logic to perform certain predetermined functions.
However, the steps required to be executed by the network request are too complicated and complicated, and the network request with inconsistent request modes cannot be monitored uniformly, so that the operation rate of the terminal is affected. Factors such as the network state of the user, the success rate of the network request, the request time length and the like can directly influence the use experience of the user, related services, the retention of the user and the like. So that the network quality of the user can be known, it is very important and meaningful to finally repair and improve the network experience of the user.
Therefore, a more suitable method for monitoring network requests is needed.
Disclosure of Invention
The disclosure provides a method, a device, a terminal device and a storage medium for monitoring a network request, so as to improve the network monitoring efficiency and ensure the operation rate of a terminal.
In a first aspect, the present disclosure provides a method for monitoring a network request, including: acquiring a plurality of network request libraries, wherein the plurality of network request libraries comprise a plurality of network request modes; converting a plurality of network request modes into a preset network request mode to obtain an updated preset network request library; setting a network monitor for the updated preset network request library, wherein the network monitor is used for monitoring the network request of the target user.
In some possible embodiments, after setting the network listener for the updated preset network request library, the method further includes: acquiring target cloud control parameters, wherein the cloud control parameters are determined based on UV (Unique identifier) dimensions; according to the target cloud control parameters, sampling the user based on UV dimension to obtain a target user; and monitoring the network request of the target user through a network monitor.
In some possible embodiments, the monitoring, by the network monitor, of the network request of the target user includes: monitoring the execution process of the network request through a network monitor to obtain monitoring data; the monitoring data comprises process information and result information, the process information is one or more time stamps, the time stamps are used for indicating time information in the execution process and corresponding state information, and the state information is used for expressing whether the time stamps are successfully executed.
In some possible implementations, the result information of the execution process includes classification information, network metadata, status information, time consuming information, error information, retry and redirect information, and data information.
In some possible embodiments, converting the multiple network request modes into a preset network request mode to obtain an updated preset network request library includes: converting various network request modes into a preset network request mode by an adapter mode; and updating the plurality of network request libraries by adopting the converted preset network request library to obtain an updated preset network request library.
In some possible embodiments, setting a network listener for the updated preset network request library includes: determining a first network request from an updated preset network request library; instantiating a first network request; generating a byte code file of the first network request; according to the tangent plane programming rule, the network monitor is set by modifying the byte code file in the instantiation.
In a second aspect, the present disclosure provides a network request monitoring apparatus, which may be a chip or a system on a chip in a terminal device, and may also be a functional module in the terminal device for implementing the method in the first aspect and any possible implementation manner thereof. The network request monitoring device may implement the functions performed by the terminal device according to the first aspect and any possible implementation manners of the first aspect, where the functions may be implemented by hardware executing corresponding software. The hardware or software comprises one or more modules corresponding to the functions. The network request monitoring device comprises: the acquisition module is used for acquiring a plurality of network request libraries, wherein the plurality of network request libraries comprise a plurality of network request modes; the conversion module is used for converting a plurality of network request modes into a preset network mode to obtain an updated preset network request library; and the monitoring module is used for setting a network monitor for the updated preset network request library, and the network monitor is used for monitoring the network request of the target user.
In some possible embodiments, the acquisition module is configured to acquire a target cloud control parameter, where the cloud control parameter is determined based on UV dimensions; according to the target cloud control parameters, sampling the user based on UV dimension to obtain a target user; and the monitoring module is used for monitoring the network request of the target user through the network monitor.
In some possible embodiments, the monitoring module is further configured to monitor, by using the network monitor, an execution process of the network request to obtain monitoring data; the method comprises the steps of monitoring data process information and result information, wherein the process information is one or more time stamps, the time stamps are used for indicating time information in an execution process and corresponding state information, and the state information is used for indicating whether the time stamps are successfully executed.
In some possible implementations, the result information of the execution process includes classification information, network metadata, status information, time consuming information, error information, retry and redirect information, and data information.
In some possible embodiments, the conversion module is further configured to convert, by means of an adapter, a plurality of network request modes into a preset network request mode; and updating the plurality of network request libraries by adopting the converted preset network request library to obtain an updated preset network request library.
In some possible embodiments, the monitoring module is further configured to determine a first network request from the updated preset network request library; instantiating a first network request; generating a byte code file of the first network request; according to the slice programming, the network listener is set by modifying the byte code file in instantiation.
In a third aspect, the present disclosure provides a terminal device, including: a memory and a processor; the processor is connected to the memory and configured to execute computer-executable instructions stored on the memory to implement the method as described in the first aspect and any possible implementation thereof.
In a fourth aspect, the present disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, enable the implementation of a method according to the first aspect and any one of its possible embodiments.
Compared with the prior art, the technical scheme provided by the disclosure has the beneficial effects that:
in the method, the network monitor is uniformly arranged on the updated network request library by converting the request modes of the network request libraries into the preset network request modes, so that the network request is monitored, the network monitoring efficiency is improved, and the running speed of the terminal is ensured.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the scope of the disclosure.
Drawings
FIG. 1 is a flow chart of a first implementation of a method for network request snooping in an embodiment of the disclosure;
FIG. 2 is a flow chart illustrating a second implementation of a method for network request snooping in an embodiment of the present disclosure;
FIG. 3 is a flow chart illustrating a third implementation of a method for network request snooping in an embodiment of the present disclosure;
FIG. 4 is a flow chart illustrating a fourth implementation of a method for network request snooping in an embodiment of the present disclosure;
FIG. 5 is an example flow chart of a method of network request snooping in an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a network request monitoring device in an embodiment of the disclosure;
fig. 7 is a schematic structural diagram of a terminal device in an embodiment of the disclosure.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the disclosed embodiments. However, it will be apparent to one skilled in the art that the present disclosure may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present disclosure with unnecessary detail.
At present, network requests in an Android system are mainly carried out through three network request libraries of OKHttpClient, httpURLConnection, httpClient, and each network request process comprises the following steps: create request task, DNS domain name resolution, establish connection, send data, and receive data. Some of the current methods of monitoring network requests in the prior art are: sampling is performed through a dimension of PV (Page View), for example, different network monitors are respectively set for the 3 network request libraries to collect data, and the data mainly comprises domain names, IP (Internet Protocol ) addresses, success and failure information of requests, duration information of the requests, parameter information of the requests and the like.
However, the above scheme has the following problems:
1. network monitoring is respectively set for the OKHttpClient network request library, the HttpURLConnection network request library and the HttpClient network request library, so that workload is additionally increased, and the monitored contents and dimensions are different due to different libraries, so that unified standards cannot be established, for example, the number of monitorable points of HttpURLConnection is small and the data of the OKHttpClient monitoring is more.
2. Existing schemes typically implement monitoring of the okttpclient network request library by explicitly setting a network event monitor, which can render previously set event monitors unusable and complex to use, and cannot guarantee complete coverage of all scenarios, and the new addition of the okttpclient network request library may not be monitored due to forgetting to set the network monitor.
3. Because the amount of data requested by the network is excessive, monitoring is typically performed by sampling the PV being requested, which does not accurately reflect the actual network request situation of the user.
4. Existing solutions monitor the results. Only the results are monitored, that is, only the final result of the user request can be reflected, but the process information of the network request cannot be reflected, so that the problem of eliminating some difficulties is difficult.
Therefore, a more suitable method for monitoring network requests is urgently needed.
In order to solve the above-mentioned problems, the embodiments of the present disclosure provide a method for monitoring network requests, which can be applied to a network request monitoring device to monitor network requests.
It should be noted that, in the process of performing network monitoring on the client, the client is configured with a network request monitoring device, so that a network request initiated by a user can be invoked, and specific forms of the client include, but are not limited to, terminal devices such as a mobile phone, a tablet computer, a notebook computer, and the like.
Fig. 1 is a flowchart of a first implementation of a method for monitoring a network request according to an embodiment of the disclosure, and referring to fig. 1, the method for monitoring a network request may include:
s101, acquiring a plurality of network request libraries.
Wherein the plurality of network request libraries include a plurality of network request modes.
It should be understood that, for a client that needs to monitor the network request status, the network request monitoring device may acquire multiple network request libraries for the user to initiate a network request to the client before monitoring the network status of the client, where each network request library is a network request manner.
In an embodiment, the network request library may be one or more of an okttpclient network request library, an httpcrlnterlink network request library, and an httppclient network request library.
S102, converting the multiple network request modes into a preset network request mode to obtain an updated preset network request library.
It should be understood that, after obtaining the multiple network request manners through S101, the network request monitoring device needs to perform conversion processing on the multiple network request manners, that is, convert the multiple network request manners into the preset network request manner, so as to obtain the updated preset network request library.
It should be noted that the conversion may be understood as analyzing and identifying the network request modes different from each other, and storing the network request modes in the network request library. That is, the conversion means converting the request pattern into a uniform request pattern. For example, the unified standard may be an OKHttpClient network request.
In some possible embodiments, the preset network request library may be an okhttpcline network request library, and then S102 may be understood as converting the htttpurl connection network request library and the htttpcline network request library into an okhttpcline network request library, so that when the network request interception is performed, only the network interception is set for the okhttpcline network request library.
S103, setting a network monitor for the updated preset network request library.
Here, the network listener is configured to listen for network requests of the target user.
It should be understood that after the network request monitoring device obtains the updated preset network request library, the network monitor may be set for the updated preset network request library, so as to monitor the network request.
In some possible embodiments, the construction method of Hook OKHttpClient can be used to set listeners for all okttpcliens, conveniently and without omission. It should be noted that, a network monitor used before may be set in the network monitor, so that the compatibility of the previous monitor may be achieved.
In some possible embodiments, the network request monitoring device may monitor the network request by means of a set network monitor. Then, fig. 2 is a schematic flow chart of a second implementation of the method for monitoring a network request in the embodiment of the present disclosure, and referring to fig. 2, the network request monitoring device may further perform S201 to S203 after performing S103.
S201, acquiring target cloud control parameters.
Here, the cloud control parameters are determined based on the independent guest UV dimensions.
It should be understood that, after the network request monitoring device sets the network monitor on the updated preset network request library in S103, the target cloud control parameter may be acquired. Here, the cloud control parameters refer to some configurations that can be pulled from the server, and the client determines whether there is hit network monitoring according to these pulled configurations (i.e., the cloud control parameters).
In an embodiment, the cloud control parameter may be a sampling rate, for example, the sampling rate may be 1%, 5%, 10%, etc.
S202, sampling the user based on the UV dimension of the independent visitor according to the target cloud control parameters to obtain the target user.
It should be understood that the network request monitoring device may perform random sampling of UV dimensions on the user to be monitored according to the cloud control parameter pulled from the server to obtain the user to be monitored, that is, the target user.
It should be noted that, sampling based on UV dimension refers to that if a user hits at random, then all network requests of the user will be collected, and if the user does not hit, then none of the network requests of the user will be sampled. Here, based on random sampling of UV dimensions, the actual condition of network requests by hit users can be reflected more accurately.
For 1000 users to be monitored, when the sampling rate is 10%, the network requests the monitoring device to randomly sample 1000 users, and then 100 users are selected, and the 100 users can be understood as target users, namely the users to be monitored.
S203, monitoring the network request of the target user through a network monitor.
It should be appreciated that after the target user is determined through S202 described above, the network request of the target user may be monitored through the network monitor.
In some possible embodiments, when performing S203 described above, the method may further include: and monitoring the execution process of the network request through a network monitor to obtain monitoring data.
Here, the listening data includes process information and result information, the process information is one or more time stamps, the time stamps are used for indicating time information in the execution process and corresponding state information, and the state information is used for expressing whether the time stamps are successfully executed.
It should be noted that, the request process of a complete network may include the following steps: DNS (Domain Name System ) resolution, TCP (Transmission Control Protocol, transmission control protocol) connection, SSL/TLS (Secure Sockets Layer, secure sockets layer protocol/Transport Layer Security, secure transport layer protocol) connection, send request message header, send request message body, receive response message header, receive response message body, and request end. However, in the above steps, each step may fail, and each step includes some additional information, so the process information may include a time stamp of each step and corresponding state information, through which the whole network request process can be intuitively and comprehensively known, and when a request failure occurs, a specific failed step and failed state information can be intuitively known.
In some possible embodiments, the result information of the above-described execution process includes classification information, network metadata, status information, time-consuming information, error information, retry and redirect information, and data information.
In some possible embodiments, the network request monitoring device may perform conversion processing on multiple network request modes in an adapter mode. Then, fig. 3 is a schematic flow chart of a third implementation of a method for monitoring a network request in an embodiment of the disclosure, and referring to fig. 3, the network request monitoring device may further include S301 to S302 when executing S102.
S301, converting various network request modes into a preset network request mode through an adapter mode.
It should be understood that the network request monitoring device may convert multiple network request modes into a preset network request mode by using an adapter mode.
In some possible embodiments, the above-mentioned method of passing through an adapter may be understood as that the network request method in the client is finally converted into a network request convenient to monitor by a code programming method in the background of the client to make the network request.
S302, updating a plurality of network request libraries by using the converted preset network request library to obtain an updated preset network request library.
It should be understood that, after the network request monitoring device obtains the converted preset network request mode in S301, the converted preset network request library may be used to update the plurality of network request libraries, so as to obtain an updated preset network request library.
In some possible embodiments, the network request snooping device may set the network snooper by way of instantiation. Then, fig. 4 is a flowchart of a fourth implementation of a method for monitoring a network request according to an embodiment of the present disclosure, and referring to fig. 4, the network request monitoring device may further include S401 to S404 when performing S103.
S401, determining a first network request from an updated preset network request library.
S402, instantiating a first network request.
S403, generating a byte code file of the first network request.
S404, setting a network monitor by modifying the byte code file in the instantiation according to the tangent plane programming rule.
It should be understood that the network request monitoring device determines a network request, i.e. the first network request, from the preset network request library obtained in S302; then, carrying out instantiation processing on the determined first network request so as to generate a byte code file of the first network request; after compiling the generated bytecode file, all the queried files related to instantiation are modified according to the tangent plane programming rules (AOP, aspect Oriented Progarmming), thereby realizing the setting of the network listener.
The method of network request interception in the embodiments of the present disclosure is described below with specific examples.
Fig. 5 is a flowchart of an example of a method for monitoring a network request in an embodiment of the disclosure, and referring to fig. 5, the method for monitoring a network request may include:
s501, the network request monitoring device acquires a plurality of network request libraries.
S502, the network request monitoring device converts various network request modes into a preset network request mode through an adapter mode.
S503, the network request monitoring device updates a plurality of network request libraries by adopting the converted preset network request library to obtain an updated preset network request library.
S504, the network request monitoring device determines a first network request from the updated preset network request library.
S505, the network request listening device instantiates a first network request.
S506, the network request monitoring device generates a byte code file of the first network request.
S507, the network request monitoring device sets a network monitor by modifying the byte code file in the instantiation according to the section programming rule.
S508, the network request monitoring device acquires the target cloud control parameters.
And S509, the network request monitoring device samples the UV dimension of the user according to the target cloud control parameters to obtain the target user.
S510, the network request monitoring device monitors the network request of the target user through the network monitor.
S511, the network requests the monitoring device to acquire the monitoring data.
Therefore, the process of monitoring the network request of the client is realized.
Therefore, in the embodiment of the disclosure, the network monitor is uniformly set for the updated network request library by converting the request modes of the plurality of network request libraries into the preset network request modes, so that the network request is monitored, the network monitoring efficiency is improved, and the running speed of the terminal is ensured. Further, converting a plurality of network request modes into a preset network request mode by an adapter mode to obtain an updated preset network request library, and then only setting uniform monitoring for the preset network request library; the network monitor is set for the updated preset network request library by using the construction method of Hook OKHttpClient, so that the compatibility of monitoring set before can be realized; the actual condition of the user network request can be reflected more accurately by using random sampling based on UV dimension; according to the obtained monitoring data, the request process state information and the result state information of the network request can be obtained. Therefore, the monitoring of the network request is realized, the network monitoring efficiency is improved, and the running speed of the terminal is ensured.
Based on the same inventive concept, the embodiments of the present disclosure provide a network request monitoring device, which may be a chip or a system on a chip in a terminal device, and may also be a functional module in the terminal device for implementing the method described in the foregoing embodiments. The network request monitoring device can realize the functions executed by the terminal equipment in the above embodiments, and the functions can be realized by hardware executing corresponding software. Such hardware or software includes one or more modules corresponding to the functions described above. Fig. 6 is a schematic structural diagram of a network request monitoring device in an embodiment of the disclosure, and referring to fig. 6, a network request monitoring device 600 may include: an obtaining module 601, configured to obtain a plurality of network request libraries, where the plurality of network request libraries include a plurality of network request modes; the conversion module 602 is configured to convert a plurality of network request modes into a preset network mode, and obtain an updated preset network request library; the monitoring module 603 sets a network monitor for the updated preset network request library, where the network monitor is used to monitor the network request of the target user.
In some possible embodiments, the obtaining module 601 is further configured to obtain a target cloud control parameter, where the cloud control parameter is determined based on the UV dimension of the independent visitor; according to the target cloud control parameters, sampling the user based on the UV dimension of the independent visitor to obtain a target user; the monitoring module 603 is further configured to monitor, by using a network monitor, a network request of the target user.
In some possible implementations, the monitor module 603 is further configured to monitor, by the network monitor, an execution process of the network request to obtain monitor data; the method comprises the steps of monitoring data process information and result information, wherein the process information is one or more time stamps, the time stamps are used for indicating time information in an execution process and corresponding state information, and the state information is used for indicating whether the time stamps are successfully executed.
In some possible implementations, the result information of the execution process includes classification information, network metadata, status information, time consuming information, error information, retry and redirect information, and data information.
In some possible embodiments, the conversion module 602 is further configured to convert, by means of an adapter, a plurality of network request modes into a preset network request mode; and updating the plurality of network request libraries by adopting the converted preset network request library to obtain an updated preset network request library.
In some possible embodiments, the monitor module 603 is further configured to determine a first network request from the updated preset network request library; instantiating a first network request; generating a byte code file of the first network request; according to the slice programming, the network listener is set by modifying the byte code file in instantiation.
It should be noted that, the specific implementation processes of the obtaining module 601, the converting module 602, and the monitoring module 603 may refer to the detailed descriptions of the embodiments of fig. 1 to 5, and for brevity of the description, the detailed descriptions are omitted here.
The acquisition module 601, the conversion module 602, and the listening module 603 mentioned in the embodiments of the present disclosure may be one or more processors.
Based on the same inventive concept, the embodiments of the present disclosure provide a terminal device, which may be consistent with the network request listening apparatus described in one or more of the embodiments above. Fig. 7 is a schematic structural diagram of a terminal device according to an embodiment of the disclosure, and referring to fig. 7, a terminal device 700 may be implemented by using general-purpose computer hardware, including a processor 701 and a memory 702.
In the alternative, processor 701 and memory 702 may communicate via bus 703.
In some possible implementations, the at least one processor 701 may constitute any physical device having circuitry to perform logical operations on one or more inputs. For example, the at least one processor may include one or more integrated circuits (integrated circuit, ICs) including application specific integrated circuits (application specific integrated circuit, ASIC), microchips, microcontrollers, microprocessors, all or part of a central processing unit (central processing unit, CPU), a graphics processing unit (graphics processing unit, GPU), a digital signal processor (digital signal process, DSP), a field programmable gate array (field programmable gate array, FPGA), or other circuit suitable for executing instructions or performing logic operations. The instructions executed by the at least one processor may, for example, be preloaded into a memory integrated with or embedded in the controller, or may be stored in a separate memory. The memory may include random access memory (random access memory, RAM), read-only memory (ROM), hard disk, optical disk, magnetic medium, flash memory, other permanent, fixed, or volatile memory, or any other mechanism capable of storing instructions. In some embodiments, at least one processor may comprise more than one processor. Each processor may have a similar structure, or the processors may have different configurations electrically connected or disconnected from each other. For example, the processors may be separate circuits or integrated in a single circuit. When more than one processor is used, the processors may be configured to operate independently or cooperatively. The processors may be coupled in electrical, magnetic, optical, acoustical, mechanical, or by other means that allow them to interact. According to one embodiment of the present disclosure, the present disclosure also provides a computer-readable storage medium having stored thereon computer instructions that are executed by a processor to perform the steps of the calibration method described above. The memory 702 may include computer storage media in the form of volatile and/or nonvolatile memory such as read only memory and/or random access memory. Memory 702 may store an operating system, application programs, other program modules, executable code, program data, user data, and the like.
In addition, the memory 702 stores computer-executable instructions for implementing the functions of the acquisition module 601, the conversion module 602, and the monitor module 603 in fig. 6. The functions/implementation procedures of the acquisition module 601, the conversion module 602, and the listening module 603 in fig. 6 may be implemented by the processor 701 in fig. 7 calling computer-executed instructions stored in the memory 702, and the specific implementation procedure and function refer to the above-mentioned related embodiments.
Based on the same inventive concept, embodiments of the present disclosure provide a terminal device, including: a memory and a processor; the processor is coupled to the memory and configured to execute computer-executable instructions stored on the memory and to implement the method of network request snooping as described in one or more embodiments above.
Based on the same inventive concept, embodiments of the present disclosure provide a computer storage medium storing computer executable instructions that, when executed by a processor, enable a method for monitoring a network request according to one or more embodiments described above to be implemented.
It will be understood by those skilled in the art that the sequence number of each step in the above embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not be construed as limiting the implementation process of the embodiments of the present disclosure. Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
While the present disclosure has been described with respect to exemplary embodiments thereof, it should be understood that the scope of the present disclosure is not limited thereto, but rather, any changes or substitutions that would be apparent to those skilled in the art within the scope of the present disclosure are intended to be included within the scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims (14)

1. A method for network request interception, the method comprising:
obtaining a plurality of network request libraries, wherein the plurality of network request libraries comprise a plurality of network request modes, and the network request libraries comprise at least one of the following: an OKHttpClient network request library, an HttpURLConnection network request library and an HttpClient network request library;
converting the multiple network request modes into a unified network request mode, and obtaining an updated preset network request library, wherein the unified network request mode comprises at least one of the following steps: an OKHttpClient network request mode, an HttpURLConnection network request mode and an HttpClient network request mode;
and setting a network monitor for the updated preset network request library, wherein the network monitor is used for monitoring the network request of the target user.
2. The method of claim 1, wherein after said setting a network listener for said updated library of preset network requests, the method further comprises:
acquiring a target cloud control parameter, wherein the cloud control parameter is determined based on the UV dimension of an independent visitor;
sampling the user based on the UV dimension of the independent visitor according to the target cloud control parameters to obtain the target user;
and monitoring the network request of the target user through the network monitor.
3. The method of claim 2, wherein the listening to the network request of the target user by the network listener comprises:
monitoring the execution process of the network request through the network monitor to obtain monitoring data;
the monitoring data comprises process information and result information, the process information is one or more time stamps, the time stamps are used for indicating time information in the execution process and corresponding state information, and the state information is used for expressing whether the time stamps are successfully executed.
4. The method of claim 3, wherein the result information of the executing process includes classification information, network metadata, status information, time consuming information, error information, retry and redirect information, and data information.
5. The method of claim 1, wherein the converting the plurality of network request modes into a unified network request mode to obtain the updated preset network request library comprises:
converting the multiple network request modes into the unified network request mode by an adapter mode;
and updating the plurality of network request libraries by adopting the converted preset network request library to obtain the updated preset network request library.
6. The method of claim 1, wherein the setting a network listener for the updated preset network request library comprises:
determining a first network request from the updated preset network request library;
instantiating the first network request;
generating a byte code file of the first network request;
and setting the network monitor by modifying the byte code file in the instantiation according to the tangent plane programming rule.
7. An apparatus for network request interception, the apparatus comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a plurality of network request libraries, the plurality of network request libraries comprise a plurality of network request modes, and the network request libraries comprise at least one of the following: an OKHttpClient network request library, an HttpURLConnection network request library and an HttpClient network request library;
the conversion module is used for converting the multiple network request modes into a unified network request mode to obtain an updated preset network request library, and the unified network request mode comprises at least one of the following steps: an OKHttpClient network request mode, an HttpURLConnection network request mode and an HttpClient network request mode;
and the monitoring module is used for setting a network monitor for the updated preset network request library, and the network monitor is used for monitoring the network request of the target user.
8. The apparatus of claim 7, wherein the apparatus further comprises:
the acquisition module is used for acquiring target cloud control parameters, and the cloud control parameters are determined based on the UV dimensions of independent visitors; sampling the user based on the UV dimension of the independent visitor according to the target cloud control parameters to obtain the target user;
and the monitoring module is used for monitoring the network request of the target user through the network monitor.
9. The apparatus of claim 8, wherein the monitor module is further configured to monitor, by the network monitor, an execution process of the network request to obtain monitor data; the process information is one or more time stamps, the time stamps are used for indicating time information in the execution process and corresponding state information, and the state information is used for indicating whether the time stamps are successfully executed or not.
10. The apparatus of claim 9, wherein the result information of the execution process includes classification information, network metadata, status information, time consuming information, error information, retry and redirect information, and data information.
11. The apparatus of claim 8, wherein the conversion module is further configured to convert the plurality of network request modes into the unified network request mode by means of an adapter; and updating the plurality of network request libraries by adopting the converted preset network request library to obtain the updated preset network request library.
12. The apparatus of claim 8, wherein the listening module is further configured to determine a first network request from the updated library of preset network requests; instantiating the first network request; generating a byte code file of the first network request; according to tangent plane programming, the network listener is set by modifying the byte code file in the instantiation.
13. A terminal device, comprising:
a memory storing computer executable instructions;
a processor, coupled to the memory, for implementing the method of any one of claims 1 to 6 by executing the computer-executable instructions.
14. A computer storage medium having stored thereon computer executable instructions which, when executed by a processor, are capable of carrying out the method of any one of claims 1 to 6.
CN202210745222.0A 2022-06-27 2022-06-27 Method, device, terminal equipment and storage medium for monitoring network request Active CN115086424B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210745222.0A CN115086424B (en) 2022-06-27 2022-06-27 Method, device, terminal equipment and storage medium for monitoring network request

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210745222.0A CN115086424B (en) 2022-06-27 2022-06-27 Method, device, terminal equipment and storage medium for monitoring network request

Publications (2)

Publication Number Publication Date
CN115086424A CN115086424A (en) 2022-09-20
CN115086424B true CN115086424B (en) 2023-10-13

Family

ID=83255912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210745222.0A Active CN115086424B (en) 2022-06-27 2022-06-27 Method, device, terminal equipment and storage medium for monitoring network request

Country Status (1)

Country Link
CN (1) CN115086424B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603593A (en) * 2015-10-15 2017-04-26 北京京东尚科信息技术有限公司 HTTP calling method and device based on adaption
CN108874833A (en) * 2017-05-15 2018-11-23 武汉斗鱼网络科技有限公司 A kind of method and device for realizing Etcd Java client
CN109981621A (en) * 2019-03-15 2019-07-05 厦门美图之家科技有限公司 Network request processing method and processing device
CN112615822A (en) * 2020-12-03 2021-04-06 北京皮尔布莱尼软件有限公司 Message processing method and device, computing equipment and readable storage medium
CN113225351A (en) * 2021-05-28 2021-08-06 中国建设银行股份有限公司 Request processing method and device, storage medium and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7668944B2 (en) * 2004-02-20 2010-02-23 Evgeny Leib System and unified setting interface for configuring network manageable devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603593A (en) * 2015-10-15 2017-04-26 北京京东尚科信息技术有限公司 HTTP calling method and device based on adaption
CN108874833A (en) * 2017-05-15 2018-11-23 武汉斗鱼网络科技有限公司 A kind of method and device for realizing Etcd Java client
CN109981621A (en) * 2019-03-15 2019-07-05 厦门美图之家科技有限公司 Network request processing method and processing device
CN112615822A (en) * 2020-12-03 2021-04-06 北京皮尔布莱尼软件有限公司 Message processing method and device, computing equipment and readable storage medium
CN113225351A (en) * 2021-05-28 2021-08-06 中国建设银行股份有限公司 Request processing method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN115086424A (en) 2022-09-20

Similar Documents

Publication Publication Date Title
CN111885123B (en) Construction method and device of cross-K8 s target service access channel
CN110727572A (en) Buried point data processing method, device, equipment and storage medium
CN105204986A (en) Automated product testing method, server and mobile equipment
CN110737891A (en) host intrusion detection method and device
CN112199567A (en) Distributed data acquisition method, system, server and storage medium
CN111147310A (en) Log tracking processing method, device, server and medium
US10594550B2 (en) Dynamic product installation based on user feedback
CN111770174A (en) Cloud platform deployment method, device, equipment and readable storage medium
CN108600377A (en) A kind of pause method of file download, device, terminal and storage medium
CN110795353A (en) Debugging method, device and equipment for fast application and storage medium
CN114356521A (en) Task scheduling method and device, electronic equipment and storage medium
CN115086424B (en) Method, device, terminal equipment and storage medium for monitoring network request
CN115996179A (en) Service node testing method and device, readable medium and electronic equipment
CN107315672B (en) Method and device for monitoring server
CN113206850A (en) Malicious sample message information acquisition method, device, equipment and storage medium
CN112804366B (en) Method and device for resolving domain name
CN111198853B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN111488268A (en) Dispatching method and dispatching device for automatic test
CN110851194A (en) Method and device for acquiring code for realizing new interface
CN111355629B (en) Client test method and device, computer equipment and storage medium
CN113810448B (en) Cloud service method, deployment method, device, electronic equipment and storage medium
CN111414200B (en) Method, apparatus, electronic device and computer readable medium for installing operating system
CN114726608A (en) Honeypot drainage method, honeypot drainage device and honeypot drainage medium
CN113132447A (en) Reverse proxy method and system
CN113434384A (en) Pressure testing method and device

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