CN108063713B - Network request processing method and device - Google Patents

Network request processing method and device Download PDF

Info

Publication number
CN108063713B
CN108063713B CN201610986361.7A CN201610986361A CN108063713B CN 108063713 B CN108063713 B CN 108063713B CN 201610986361 A CN201610986361 A CN 201610986361A CN 108063713 B CN108063713 B CN 108063713B
Authority
CN
China
Prior art keywords
network
request
network request
terminal
unit
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
CN201610986361.7A
Other languages
Chinese (zh)
Other versions
CN108063713A (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 Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum 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 Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201610986361.7A priority Critical patent/CN108063713B/en
Publication of CN108063713A publication Critical patent/CN108063713A/en
Application granted granted Critical
Publication of CN108063713B publication Critical patent/CN108063713B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Abstract

The invention discloses a method and a device for processing a network request, relates to the technical field of internet, and mainly aims to analyze the network request generated by a terminal locally and count and display the analysis result when a VPN (virtual private network) service is started so as to improve the response rate of the terminal counting and displaying the analysis result of the network request. The main technical scheme of the invention is as follows: acquiring a network request of a terminal application in a virtual private network; storing the network request into a cache of the terminal; analyzing according to the message format of the network request in the cache to obtain the analysis result of the network request; and counting and displaying the analysis result. The method and the device are mainly used for locally processing the network request locally generated by the terminal.

Description

Network request processing method and device
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method and an apparatus for processing a network request.
Background
Virtual Private Network (VPN) refers to a technology for establishing a Private Network on a public Network. A VPN network may be understood as an enterprise-wide virtual line. It can be connected by a special encrypted communication protocol, and a private communication line is established between two or more intranets located at different places on the Internet. Generally, after a terminal in a VPN network starts a VPN service, all network requests in the terminal are acquired by a virtual network card and sent to a VPN server, the VPN server receives the network request of the terminal and analyzes the network request, and then forwards the network request to a corresponding target server according to an analysis result, and receives data returned by the target server. Meanwhile, when the terminal counts and displays the specific content of the network request initiated locally, the terminal needs to acquire the analysis result of the terminal network request from the VPN server, so as to count and display the content.
However, in the existing VPN network, a VPN server often needs to provide VPN network services to a large number of terminals, and at this time, the VPN server needs to process a large number of network requests at the same time, and due to relatively limited processing capability, a queuing processing phenomenon may be caused, so that a large number of network requests may not be processed in time, and thus an analysis result of a corresponding network request may not be fed back to each terminal, which may cause that the terminal may lag relatively when counting and displaying the analysis result of the network request, and affect the user operation experience.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for processing a network request, and mainly aims to locally analyze a network request generated by a terminal when a VPN service is opened and to count and display an analysis result, so as to improve a response rate of the terminal counting and displaying the analysis result of the network request.
In order to achieve the purpose, the invention mainly provides the following technical scheme:
in one aspect, the present invention provides a method for processing a network request, where the method includes:
acquiring a network request of a terminal application in a virtual private network;
storing the network request into a cache of the terminal;
analyzing according to the message format of the network request in the cache to obtain the analysis result of the network request;
and counting and displaying the analysis result.
Preferably, before parsing according to a message format requested by the network in the cache, the method further includes:
reading a request message of the network request from the cache;
analyzing header information in the request message, the header information comprising: version, protocol, source address and port number, and destination address and port number of the message;
and determining the message format of the network request according to the header information.
Preferably, the analyzing according to the message format of the network request in the cache to obtain the analysis result of the network request includes:
determining a target server to be accessed by the network request according to the target address and the port number in the request message;
determining the field position of the request data in the request message according to the message format;
and extracting the request data according to the field position.
Preferably, the acquiring the network request of the terminal application in the virtual private network includes:
establishing a virtual network card in a terminal, wherein the virtual network card is used for configuring a virtual network interface for the terminal and connecting the virtual private network server;
and acquiring a network request of the terminal application in the virtual private network by using the virtual network card.
Preferably, after parsing according to the message format of the network request in the cache to obtain the parsing result of the network request, the method further includes:
extracting a target server to be accessed by the network request from the analysis result;
and sending the network request to the target server.
In another aspect, the present invention further provides a device for processing a network request, where the device includes:
an obtaining unit, configured to obtain a network request of a terminal application in a virtual private network;
the storage unit is used for storing the network request obtained by the acquisition unit into a cache of the terminal;
the analysis unit is used for analyzing according to the message format of the network request cached in the storage unit to obtain the analysis result of the network request;
and the processing unit is used for counting and displaying the analysis result obtained by the analysis unit.
Preferably, the apparatus further comprises:
a reading unit, configured to read a request packet of the network request from the cache before an analysis unit performs analysis according to a packet format of the network request in the cache;
an analyzing unit, configured to analyze header information in the request message obtained by the reading unit, where the header information includes: version, protocol, source address and port number, and destination address and port number of the message;
and the determining unit is used for determining the message format of the network request according to the header information obtained by the analyzing unit.
Preferably, the analysis unit includes:
a determining module, configured to determine, according to a target address and a port number in the request message, a target server to be accessed by the network request;
the determining module is further configured to determine a field position of the request data in the request message according to the message format;
and the extraction module is used for extracting the request data according to the field position determined by the determination module.
Preferably, the acquiring unit includes:
the system comprises a creating module, a virtual private network server and a virtual network interface module, wherein the creating module is used for creating a virtual network card in a terminal, and the virtual network card is used for configuring a virtual network interface for the terminal and connecting the virtual private network server;
and the acquisition module is used for acquiring the network request of the terminal application in the virtual private network by using the virtual network card established by the creation module.
Preferably, the apparatus further comprises:
the extracting unit is used for extracting a target server to be accessed by the network request from the analysis result after the analysis unit analyzes the network request according to the format of the network request in the cache to obtain the analysis result of the network request;
and the sending unit is used for sending the network request to the target server obtained by the extracting unit.
According to the method and the device for processing the network request, provided by the invention, under the condition that the VPN service is started, the network request sent by the terminal application is obtained, the analysis operation is completed locally at the terminal, the analysis result is displayed in the terminal, meanwhile, the target server to be accessed by the network request can be determined according to the obtained analysis result, and the network request is sent to the target server. Compared with the network request processing mode under the existing VPN service, the invention realizes the localized analysis and display of the network request, so that the network request analysis result to be displayed does not need to be obtained from a VPN server, but the analysis result can be directly obtained from the terminal, thereby improving the response rate of the terminal when counting and displaying the local network request analysis result. In addition, for the VPN server, the VPN server is not required to return the analysis result of the network request to the terminal, so that the processing pressure of the VPN server can be reduced, and the bandwidth resource occupied by sending the analysis result is reduced.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating a method for processing a network request according to an embodiment of the present invention;
fig. 2 is a flow chart of another method for processing a network request according to an embodiment of the present invention;
FIG. 3 illustrates a format of a network request message;
fig. 4 is a block diagram illustrating a device for processing a network request according to an embodiment of the present invention;
fig. 5 is a block diagram illustrating another apparatus for processing a network request according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
An embodiment of the present invention provides a method for processing a network request, where as shown in fig. 1, the method is applied in a terminal capable of using a VPN network service function to implement analysis processing of a network request generated by the terminal locally at the terminal, and for this, the following specific steps are provided in the embodiment of the present invention:
101. and acquiring a network request of the terminal application in the VPN network.
At present, after a VPN service is opened in a terminal, a system automatically intercepts network requests generated by all applications in the terminal, and all the network requests are sent to a VPN server for uniform analysis processing. Specifically, a virtual network card is created in the terminal, the virtual network card is used for communication connection between the terminal and the VPN server, and the virtual network card acquires network requests of all applications in the terminal. In this step, the characteristics of the network requests of all applications in the terminal, which can be obtained by the virtual network card when the VPN service is opened, are also utilized, and the network requests intercepted by the virtual network card are directly obtained under the condition that the VPN service is opened. These network requests include network requests of the terminal system itself and network requests of third party applications installed on the terminal.
102. And storing the network request into a cache of the terminal.
When the virtual network card of the terminal acquires the network request, the terminal caches the network request, and the embodiment of the invention does not limit the specific caching mode, and the network request can be directly extracted from the virtual network card and stored in the cache of the terminal, or the network request acquired by the virtual network card can be copied and stored in the cache of the terminal.
It should be noted that, when caching network requests, the embodiments of the present invention do not limit the number of cached network requests, and may only cache one network request, delete the network request after the resolution is completed, and cache the next network request, or establish a queue in the terminal cache, cache the network requests in the queue, and perform resolution processing one by one.
103. And analyzing according to the message format of the network request in the terminal cache to obtain the analysis result of the network request.
The format of the network request refers to a manner of interaction between the client and the server, for example, the network request manner included in the http protocol is to search, modify, add, and delete network resources, that is, get, post, put, and delete. According to the specific format of the network request, the network request data is analyzed in different ways, so as to obtain a corresponding network request analysis result, that is, relevant parameter data in the network request, such as an address and a port number of an access target server, a type, a date, a size and the like of the request data, is obtained.
Generally, the network request is transmitted in the form of a message, and different network requests may adopt different message formats, such as an IP message, a TCP message, a UDP message, and the like.
104. And carrying out statistics and presentation on the obtained analysis result.
In this step, the analysis result obtained in step 103 is analyzed locally at the terminal, for the parameter data to be counted, the corresponding data in the extracted analysis result and the existing data are summarized and counted, and for the parameter data to be displayed, the corresponding data content is visually output according to the specific format to be displayed. The specific way of statistics and presentation is not the focus of the embodiment of the present invention, and the implementation way is not limited to one of the existing applications. In this step, what should be embodied is that the analysis result of statistics and presentation is obtained from the local terminal, and it is not necessary to obtain the corresponding data content from the VPN server.
It can be seen from the foregoing implementation manner that, in the method for processing a network request according to the embodiment of the present invention, when the VPN service is opened, the network request sent by the terminal application is acquired, the analysis operation is completed locally at the terminal, the analysis result is displayed in the terminal, and meanwhile, according to the obtained analysis result, the target server to be accessed by the network request can be determined, and the network request is sent to the target server. Compared with the network request processing mode under the existing VPN service, the embodiment of the invention realizes the localized analysis and display of the network request, so that the analysis result of the network request to be displayed is not required to be obtained from a VPN server, but the analysis result can be directly obtained from the terminal, and the response rate of the terminal in counting and displaying the local network request analysis result is improved. In addition, for the VPN server, the VPN server is not required to return the analysis result of the network request to the terminal, so that the processing pressure of the VPN server can be reduced, and the bandwidth resource occupied by sending the analysis result is reduced.
In order to describe the processing method of a network request in more detail, particularly a specific processing manner of the network request locally at the terminal after the VPN service is opened, as shown in fig. 2, the method includes the following steps:
201. and acquiring a network request of the terminal application in the VPN network.
And acquiring network requests of all applications in the terminal by using the virtual network card established in the terminal. The main content of this step is the same as step 101 in the above embodiment, and reference may be made to the above step for details, which are not described herein again.
202. And storing the network request into a cache of the terminal.
The content of this step is the same as that of step 102 in the above embodiment, and reference may be made to the above step specifically, which is not described herein again.
203. And analyzing according to the message format of the network request in the terminal cache to obtain the analysis result of the network request.
Firstly, to analyze a network request, a network request needs to be acquired first, and in the embodiment of the invention, the cached network request is extracted from a cache of a terminal, namely a request message of the network request is extracted.
Next, the message format of the extracted network request is determined, in the embodiment of the present invention, an HTTP request message is described as an example, one HTTP request message is composed of 4 parts, namely, a request line (request line), a request header (header), a null line, and request data, as shown in fig. 3, and is a general format of a request message, wherein the request line is composed of 3 fields, namely, a request method field, a URL field, and an HTTP protocol version field, which are separated by a space. Html HTTP/1.1, for example GET/index. The HTTP protocol request method includes GET, POST, HEAD, PUT, DELETE, OPTIONS, TRACE, CONNECT. The most common GET and POST methods are described here; the request header consists of key/value pairs, one pair per row, with the key and value separated by the english colon ": to. The request header informs the server about the information requested by the client, and typical request headers are: User-Agent: browser type of the generation request, Accept: a content type list which can be identified by the client, Host: the requested host name, which allows a plurality of domain names to be co-located with one IP address, namely a virtual host; an empty line is arranged behind the last request head, and the return character and the line feed character are sent to inform the server that no request head exists below the server; the request data is not used in the GET method but is used in the POST method. The POST method is suitable for occasions where customers are required to fill in forms. The most commonly used request headers associated with the requested data are Content-Type and Content-Length.
As can be seen, determining the message format of the network request is to obtain data information of each component in header information of the request message, where the main data information for distinguishing the message format includes: version of the message, protocol, source address and port number, and destination address and port number, etc. In this regard, the present invention implements pseudo code that provides for obtaining data information in a request message in a java environment:
version=(byte)(buffer.get()>>4);
protocolNum=(short)(buffer.get()&0xFF);
protocol=getProtolByNum(protocolNum);
byte[]addressBytes=new byte[4];
buffer.get(addressBytes,0,4);
destinationAddress=InetAddress.getByAddress(addressBytes)。
the process of executing the pseudo code mainly determines the version number of the IP protocol according to the head 4 bits of the request message, namely, the version is judged to be IP v4 or IP v6, the currently used version is IP v4, and the data value is 0100; acquiring 5-12 bits of data to judge the type of the adopted protocol, such as tcp protocol, udp protocol and the like; and then acquiring 32 bits occupied by the target address, namely 4 bytes of data, and converting the byte array addresses into IP addresses by using a function provided by java, namely the target address.
In practical application, often, while determining the format of the network request message, the relevant parameter data in the network request can be obtained according to the content and the position of different fields in the message, that is, the analysis of the network request is performed.
And finally, analyzing the network request according to the determined message format to obtain an analysis result of the network request. According to the above example, the purpose of determining the format of the network request message is to determine the field allocation of each part in the message, and the analysis of the network request message is a process of converting by acquiring data of each part of the field. That is, the data of the fields at different positions in the message are obtained according to the message format, so as to obtain the relevant parameter data contained in the network request.
204. And carrying out statistics and presentation on the obtained analysis result.
The content of this step is the same as step 104 in the above embodiment, and reference may be made to the above step specifically, which is not described herein again.
205. And sending the network request to a target server according to the analysis result of the network request.
Because the network request can be analyzed in real time locally at the terminal and the relevant parameter data of the network request can be obtained, the embodiment of the invention can carry out local operation on the network request based on the characteristics. For example, the address of the target server to which the network request is to be accessed can be known from the target address information of the analysis result, and the network request can be directly sent to the target server without being forwarded through the VPN server when the VPN service is opened according to the address. Therefore, the network request to be processed sent by the terminal to the VPN server can be reduced, so that the workload of the VPN server is introduced, meanwhile, due to the network request directly sent by the terminal, the data information fed back by the target server aiming at the network request is also directly returned to the terminal without being forwarded by the VPN server, and the network request processing efficiency and the response speed are improved.
In addition, before sending the network request to the target server, the connectivity of the target server can be judged to determine that the target server can be accessed without the VPN server. In this regard, the embodiments of the present invention are not limited to using PING commands to determine connectivity of target servers, or to setting a server white list in advance to define target servers that can be directly accessed.
Further, as an implementation of the foregoing method, an embodiment of the present invention provides a device for processing a network request, where the embodiment of the device corresponds to the foregoing method embodiment, and for convenience of reading, details in the foregoing method embodiment are not described in detail again in this device embodiment, but it should be clear that the device in this embodiment can correspondingly implement all the contents in the foregoing method embodiment. The apparatus is used for localized processing of a network request in a terminal capable of using a VPN network service function, and specifically, as shown in fig. 4, the apparatus includes:
an obtaining unit 41, configured to obtain a network request of a terminal application in a virtual private network;
a storage unit 42, configured to store the network request obtained by the obtaining unit 41 in a cache of a terminal;
an analyzing unit 43, configured to perform analysis according to the message format of the network request cached in the storage unit 42, so as to obtain an analysis result of the network request;
and a processing unit 44, configured to count and present the analysis result obtained by the analysis unit 43.
Further, as shown in fig. 5, the apparatus further includes:
a reading unit 45, configured to read a request packet of the network request from the cache before the parsing unit 43 parses the packet according to the format of the network request in the cache;
an analyzing unit 46, configured to analyze header information in the request message obtained by the reading unit 45, where the header information includes: version, protocol, source address and port number, and destination address and port number of the message;
a determining unit 47, configured to determine a message format of the network request according to the header information extracted by the analyzing unit 46.
Further, as shown in fig. 5, the analysis unit 43 includes:
a determining module 431, configured to determine, according to the destination address and the port number in the request message, a destination server to be accessed by the network request;
the determining module 431 is further configured to determine, according to the message format, a field position of request data in the request message;
an extracting module 432, configured to extract the request data according to the field position determined by the determining module 431.
Further, as shown in fig. 5, the acquiring unit 41 includes:
a creating module 411, configured to create a virtual network card in a terminal, where the virtual network card is used to configure a virtual network interface for the terminal and connect to the virtual private network server;
an obtaining module 412, configured to obtain, in the virtual private network, a network request of a terminal application by using the virtual network card established by the creating module 411.
Further, as shown in fig. 5, the apparatus further includes:
an extracting unit 48, configured to, after the parsing unit 43 parses according to the format of the network request in the cache to obtain a parsing result of the network request, extract a target server to be accessed by the network request from the parsing result;
a sending unit 49, configured to send the network request to the target server obtained by the extracting unit 48.
In summary, the method and the device for processing a network request according to the embodiments of the present invention obtain a network request sent by a terminal application and complete an analysis operation locally at the terminal when a VPN service is opened, show an analysis result in the terminal, and meanwhile, according to the obtained analysis result, can determine a target server to which the network request is to access, and send the network request to the target server. Compared with the network request processing mode under the existing VPN service, the embodiment of the invention realizes the localized analysis and display of the network request, so that the analysis result of the network request to be displayed is not required to be obtained from a VPN server, but the analysis result can be directly obtained from the terminal, and the response rate of the terminal in counting and displaying the local network request analysis result is improved. In addition, for the VPN server, the VPN server is not required to return the analysis result of the network request to the terminal, so that the processing pressure of the VPN server can be reduced, and the bandwidth resource occupied by sending the analysis result is reduced.
The network request processing device comprises a processor and a memory, wherein the acquisition unit, the storage unit, the analysis unit, the processing unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the kernel parameters are adjusted to realize that the network request generated by the terminal is locally analyzed and the analysis result is counted and displayed when the VPN service is started, so that the response rate of the terminal counting and displaying the analysis result of the network request is improved.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
The present application further provides a computer program product adapted to perform program code for initializing the following method steps when executed on a data processing device: acquiring a network request of a terminal application in a virtual private network; storing the network request into a cache of the terminal; analyzing according to the message format of the network request in the cache to obtain the analysis result of the network request; and counting and displaying the analysis result.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (8)

1. A method for processing a network request, the method comprising:
the method for acquiring the network request of the terminal application in the virtual private network specifically comprises the following steps: establishing a virtual network card in a terminal, wherein the virtual network card is used for configuring a virtual network interface for the terminal and connecting the virtual private network server; acquiring a network request of a terminal application in the virtual private network by using the virtual network card, further comprising: directly acquiring network requests intercepted by the virtual network card under the condition of starting the VPN service by utilizing the characteristics of the network requests of all applications in the terminal, which can be acquired by the virtual network card when the VPN service is started;
storing the network request into a cache of the terminal;
analyzing according to the message format of the network request in the cache to obtain the analysis result of the network request;
counting and displaying the analysis result;
extracting a target server to be accessed by the network request from the analysis result;
before sending a network request to a target server, judging the connectivity of the target server to determine whether the target server is not switched to access through a VPN (virtual private network) server, and if so, sending the network request to the target server.
2. The method of claim 1, wherein prior to parsing according to a message format of a network request in the cache, the method further comprises:
reading a request message of the network request from the cache;
analyzing header information in the request message, the header information comprising: version, protocol, source address and port number, and destination address and port number of the message;
and determining the message format of the network request according to the header information.
3. The method according to claim 2, wherein the parsing according to the message format of the network request in the cache to obtain the parsing result of the network request comprises:
determining a target server to be accessed by the network request according to the target address and the port number in the request message;
determining the field position of the request data in the request message according to the message format;
and extracting the request data according to the field position.
4. An apparatus for processing network requests, the apparatus comprising:
an obtaining unit, configured to obtain a network request of a terminal application in a virtual private network;
the acquisition unit includes: the system comprises a creating module, a virtual private network server and a virtual network interface module, wherein the creating module is used for creating a virtual network card in a terminal, and the virtual network card is used for configuring a virtual network interface for the terminal and connecting the virtual private network server; an obtaining module, configured to obtain, in the virtual private network, a network request of a terminal application by using the virtual network card established by the creating module, where the obtaining module further includes: directly acquiring network requests intercepted by the virtual network card under the condition of starting the VPN service by utilizing the characteristics of the network requests of all applications in the terminal, which can be acquired by the virtual network card when the VPN service is started;
the storage unit is used for storing the network request obtained by the acquisition unit into a cache of the terminal;
the analysis unit is used for analyzing according to the message format of the network request cached in the storage unit to obtain the analysis result of the network request;
the processing unit is used for counting and displaying the analysis result obtained by the analysis unit;
the extracting unit is used for extracting a target server to be accessed by the network request from the analysis result after the analysis unit analyzes the network request according to the format of the network request in the cache to obtain the analysis result of the network request;
and the sending unit is used for judging the connectivity with the target server before sending the network request to the target server so as to determine whether the target server is not switched to access through the VPN server, and if so, sending the network request to the target server obtained by the extracting unit.
5. The apparatus of claim 4, further comprising:
a reading unit, configured to read a request packet of the network request from the cache before an analysis unit performs analysis according to a packet format of the network request in the cache;
an analyzing unit, configured to analyze header information in the request message obtained by the reading unit, where the header information includes: version, protocol, source address and port number, and destination address and port number of the message;
and the determining unit is used for determining the message format of the network request according to the header information obtained by the analyzing unit.
6. The apparatus of claim 5, wherein the parsing unit comprises:
a determining module, configured to determine, according to a target address and a port number in the request message, a target server to be accessed by the network request;
the determining module is further configured to determine a field position of the request data in the request message according to the message format;
and the extraction module is used for extracting the request data according to the field position determined by the determination module.
7. A storage medium, characterized in that the storage medium comprises a stored program, wherein when the program runs, a device in which the storage medium is located is controlled to execute the network request processing method of any one of claims 1 to 3.
8. A processor, characterized in that the processor is configured to execute a program, wherein the program executes the method for processing the network request according to any one of claim 1 to claim 3.
CN201610986361.7A 2016-11-09 2016-11-09 Network request processing method and device Active CN108063713B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610986361.7A CN108063713B (en) 2016-11-09 2016-11-09 Network request processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610986361.7A CN108063713B (en) 2016-11-09 2016-11-09 Network request processing method and device

Publications (2)

Publication Number Publication Date
CN108063713A CN108063713A (en) 2018-05-22
CN108063713B true CN108063713B (en) 2021-02-12

Family

ID=62137852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610986361.7A Active CN108063713B (en) 2016-11-09 2016-11-09 Network request processing method and device

Country Status (1)

Country Link
CN (1) CN108063713B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113852635A (en) * 2021-09-26 2021-12-28 招商银行股份有限公司 Task processing method and device, terminal equipment and storage medium
CN114363031A (en) * 2021-12-29 2022-04-15 中国电信股份有限公司 Network access method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102457565A (en) * 2010-11-03 2012-05-16 中国电信股份有限公司 Method for accessing network by mobile terminal, and agency server
CN103765851A (en) * 2011-06-30 2014-04-30 思杰系统有限公司 Systems and methods for transparent layer 2 redirection to any service
CN105847319A (en) * 2016-02-22 2016-08-10 乐视移动智能信息技术(北京)有限公司 Mobile terminal network request method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103840994B (en) * 2012-11-23 2017-06-06 华耀(中国)科技有限公司 A kind of user terminal accesses the system and method for Intranet by VPN

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102457565A (en) * 2010-11-03 2012-05-16 中国电信股份有限公司 Method for accessing network by mobile terminal, and agency server
CN103765851A (en) * 2011-06-30 2014-04-30 思杰系统有限公司 Systems and methods for transparent layer 2 redirection to any service
CN105847319A (en) * 2016-02-22 2016-08-10 乐视移动智能信息技术(北京)有限公司 Mobile terminal network request method and system

Also Published As

Publication number Publication date
CN108063713A (en) 2018-05-22

Similar Documents

Publication Publication Date Title
CN107341160B (en) Crawler intercepting method and device
CN104580192B (en) The treating method and apparatus of the network access request of application program
US20180019961A1 (en) Message processing method, processing server, terminal, and storage medium
CN108063714B (en) Network request processing method and device
CN109640113B (en) Processing method for dragging video data and proxy server
CN104301443A (en) Method and system for calling end capacity ports on web page
CN108418847B (en) Network traffic caching system, method and device
CN110769009B (en) User identity authentication method and system
CN112559463B (en) Compressed file processing method and device
US20210400114A1 (en) Methods and apparatus for census and panel matching using http headers
EP3896940A1 (en) Resource description file processing, and page resource obtaining method and device
CN108063713B (en) Network request processing method and device
CN112738637A (en) Web page real-time video playing method and device and computer equipment
CN107979627B (en) Network request processing method and device
CN106878311B (en) HTTP message rewriting method and device
CN108512889B (en) Application response pushing method based on HTTP and proxy server
CN112994982A (en) Packet capture control method, device and system of cloud-real machine and storage medium
CN106648610B (en) Method and device for remotely calling and responding functional interface
CN111224891A (en) Traffic application identification system and method based on dynamic learning triples
CN117642724A (en) Stream analysis using server-less computing system
CN110933121A (en) Connection establishing method, communication processing method and device and communication equipment
CN106664223B (en) Method and device for detecting number of shared access hosts
CN114024758A (en) Flow characteristic extraction method, system, storage medium and electronic equipment
CN111416792B (en) Internal authentication-free method of embedded equipment and embedded equipment
CN107979517B (en) Network request processing 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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant