Program traffic processing method and device, medium and computer program product

By intercepting and encapsulating process information at the application layer through a layered service provider, and combining real-time parsing and policy execution by a proxy service program, the compatibility and latency issues caused by driver dependency in existing technologies are resolved. This achieves driver-free traffic processing and ensures the timely and effective execution of traffic policies.

CN121887520APending Publication Date: 2026-04-17XUNLEI NETWORKING TECHNOLOGIES LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610114908.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-27
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing network traffic processing solutions rely on drivers, leading to system stability and compatibility issues, and the inability to obtain application layer communication requests in a timely manner results in inaccurate policy execution.

Method used

By intercepting application communication requests through a layered service provider, encapsulating process information, and redirecting them to a proxy service program, traffic policy execution can be achieved, avoiding reliance on underlying drivers.

Benefits of technology

It improves system compatibility and deployment flexibility, ensures the timeliness and accuracy of traffic processing, overcomes the defects caused by driver layer latency, and achieves early and accurate traffic interception and processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121887520A_ABST
    Figure CN121887520A_ABST
Patent Text Reader

Abstract

The invention discloses a program traffic processing method and device, a medium and a program product, which are applied to a terminal loaded with a hierarchical service providing program, and the method comprises the following steps: intercepting an original communication request initiated by an application program through the hierarchical service providing program; when the original communication request meets a preset condition, packaging process information of a target process in the application program into the communication request to obtain a target communication request; wherein the target process is a process for initiating the original communication request; and redirecting the target communication request to a proxy service program, and indicating the proxy service program to execute a corresponding flow strategy based on the process information. Through active marking and redirection of the application program, in cooperation with real-time analysis and strategy execution of the proxy service program, early-stage, accurate and drive-dependence-free traffic interception and processing are realized, so that the system stability is improved, and meanwhile, timely and effective execution of a traffic strategy is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a method and apparatus for processing program traffic, a medium, and a computer program product. Background Technology

[0002] Existing network traffic processing solutions typically rely on drivers, such as WFP (Windows Filtering Platform), to intercept and redirect traffic. However, this approach has significant drawbacks: First, drivers may fail to load correctly in certain system environments, causing traffic processing to malfunction and impacting system stability and reliability. Second, drivers heavily depend on underlying system services, such as BFE (Base Filtering Engine), increasing system deployment complexity and compatibility risks. Furthermore, due to processing latency between the driver layer and the application layer, these solutions often fail to receive communication requests initiated by the application layer in a timely manner, leading to delayed traffic processing or inaccurate policy execution.

[0003] Therefore, how to effectively intercept traffic and enforce policies without relying on drivers is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention

[0004] The purpose of this application is to provide a method, device, medium, and computer program product for processing program traffic, which achieves effective interception and policy execution of traffic without relying on drivers.

[0005] To achieve the above objectives, this application provides a method for processing program traffic, applied to a terminal loaded with a layered service provider, the method comprising: The layered service provider intercepts the original communication requests initiated by the application; When the original communication request meets the preset conditions, the process information of the target process in the application is encapsulated into the original communication request to obtain the target communication request; wherein, the target process is the process that initiated the original communication request; The target communication request is redirected to the proxy service program, which is then instructed to execute the corresponding traffic policy based on the process information.

[0006] Optionally, before intercepting the original communication request initiated by the application through the layered service provider, the method further includes: Load the dynamic link library corresponding to the layered service provider into the process space of the application.

[0007] Optionally, the preset condition includes a preset function, which includes any one or a combination of any of the following: connection control function, socket connection establishment function, data sending function, socket closing function, and name service provider query function.

[0008] Optionally, the process information of the target process in the application is encapsulated into the original communication request to obtain the target communication request, including: Obtain the process information of the target process and the original destination address of the original communication request; wherein, the process information includes the identifier and / or name of the target process; The process information and the original destination address are encapsulated into the original communication request to obtain the target communication request.

[0009] To achieve the above objectives, this application provides a method for processing program traffic, applied to a proxy service program in a terminal, the method comprising: Listen on a preset port in the local terminal; The target communication request is received through the preset port, wherein the target communication request is a request that is intercepted by the layered service program, encapsulated with process information, and then redirected to the preset port; The target communication request is parsed to obtain the process information encapsulated in the target communication request; The corresponding traffic strategy is executed based on the process information.

[0010] Optionally, before listening on a preset port on the local terminal, the process further includes: The dynamic link library of the layered service provider is registered as a socket provider in the operating system's socket layered service provider chain.

[0011] Optionally, executing the corresponding traffic strategy based on the process information includes: Query the corresponding policy rules based on the process information; If the policy rule is to allow, the process information encapsulated in the target communication request is stripped to obtain the original communication request, and based on the original destination address encapsulated in the target communication request, the original communication request is directly forwarded to the target server. If the policy rule is proxy forwarding, the process information encapsulated in the target communication request is stripped to obtain the original communication request, and based on the original destination address encapsulated in the target communication request, the original communication request is forwarded to the target server through a preset proxy channel; If the policy rule is to block, then the target communication request is discarded.

[0012] To achieve the above objectives, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor is used to implement the steps of the program traffic processing method described above when executing the computer program.

[0013] To achieve the above objectives, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the program flow processing method described above.

[0014] To achieve the above objectives, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the program traffic processing method described above.

[0015] The application traffic processing method provided in this application intercepts and redirects communication requests that meet preset conditions through a layered service provider within the application. This eliminates reliance on underlying drivers, avoiding issues such as driver loading failures or service dependencies, and improving system compatibility and deployment flexibility. When redirecting communication requests, the application actively adds process information, enabling the proxy service program to directly parse the process information corresponding to the request upon receipt and then process it promptly and accurately according to the preset traffic strategy. This mechanism ensures that traffic processing occurs at the application layer request initiation stage, overcoming the shortcomings of related technologies where driver layer delays prevent the timely acquisition of application layer traffic. Therefore, this application, through application-layer active marking and redirection, combined with real-time parsing and policy execution by the proxy service program, achieves early, accurate, and driver-independent traffic interception and processing, thereby improving system stability while ensuring the timely and effective execution of traffic strategies.

[0016] This application also discloses a traffic processing method, an electronic device, a computer-readable storage medium, and a computer program product, which can achieve the same technical effects as described above.

[0017] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this application. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. The drawings are used to provide a further understanding of this disclosure and constitute a part of the specification. They are used together with the following detailed description to explain this disclosure, but do not constitute a limitation of this disclosure. In the drawings: Figure 1 This is a flowchart illustrating a process traffic processing method according to an exemplary embodiment; Figure 2 A flowchart illustrating another method for processing program traffic according to an exemplary embodiment; Figure 3 An architecture diagram of an application embodiment provided in this application; Figure 4 This is a structural diagram of an electronic device according to an exemplary embodiment. Detailed Implementation

[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0020] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0021] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0022] This application discloses a traffic processing method that achieves effective traffic interception and policy execution without relying on drivers.

[0023] See Figure 1 A flowchart illustrating a traffic processing method according to an exemplary embodiment, such as... Figure 1 As shown, it includes: S101: Intercept raw communication requests initiated by applications through a layered service provider; In this embodiment, the execution entity is a terminal loaded with a Layered Service Provider (LSP). An application refers to a software program running on the terminal that can initiate communication requests, such as a network game client or a browser. A communication request refers to a data packet constructed by the application to complete network communication; its protocol type may include Transmission Control Protocol (TCP) or User Datagram Protocol (UDP). A Layered Service Provider (LSP) is a pluggable middleware component in the Winsock network architecture of the Windows operating system, used to insert custom logic between the application and the underlying transport protocol (such as TCP / UDP).

[0024] In this step, when any application in the terminal initiates a raw communication request, the request is intercepted by the layered service provider instead of being directly passed to the underlying protocol stack. Therefore, this step can obtain complete application layer traffic in the early stages of user space without installing kernel drivers or relying on system services (such as BFE), avoiding compatibility issues caused by driver loading failures or delays in traditional WFP solutions.

[0025] As a feasible implementation, before intercepting the original communication request initiated by the application through the layered service provider, the method further includes: loading the dynamic link library corresponding to the layered service provider into the process space of the application.

[0026] In practice, a layered service provider (LSP) is essentially a dynamic link library (DDL) that implements the Winsock SPI (Service Provider Interface). To enable it to intercept network communications from a specific application, this DLL must be loaded into the target application's user-mode process address space. In Windows systems, LSPs are typically registered to the system Winsock directory via APIs such as WSCInstallProvider or WSCWriteProviderOrder. The operating system then automatically loads the corresponding LSP DLL into the application's process space when the application calls WSAStartup, allowing the layered service provider to intervene in the application's network call process.

[0027] S102: When the original communication request meets the preset conditions, the process information of the target process in the application is encapsulated into the original communication request to obtain the target communication request; wherein, the target process is the process that initiated the original communication request; Among these, preset conditions refer to pre-defined traffic filtering rules. Process information refers to data that uniquely identifies the process that initiated the communication request, typically including process identifier, process name, etc.

[0028] In this step, the layered service provider intercepts the communication request initiated by the application and first determines whether the original communication request meets the preset conditions. If it does, it embeds the process information of the process that initiated the original communication request, i.e. the target process, into the request data packet, thereby obtaining the target communication request.

[0029] As a feasible implementation method, the preset condition is to include preset functions, which include any one or a combination of any of the following: connection control function, socket connection establishment function, data sending function, socket closing function, and name service provider query function.

[0030] In practice, the layered service provider redirects communication requests according to preset functions. These functions are the core of the Windows Sockets Application Programming Interface (Windows Sockets Interface), such as the Network Input / Output Control (WSPIoctl) function, the Connection Establishment function (WSPConnect), the Data Sending (WSPSend, WSPSendTo) function, the Socket Closing function, and the Name Service Provider Lookup (NSPLookupServiceBegin, NSPLookupServiceNext, NSPLookupServiceEnd) function. Among these, the Name Service Provider functions NSPLookupServiceBegin, NSPLookupServiceNext, and NSPLookupServiceEnd are key interfaces specifically for handling domain name resolution requests. When an application initiates a DNS query, the layered service provider intercepts the query request by hooking these functions and embeds the process information of the process that initiated the DNS (Domain Name System) request. This allows subsequent proxy service programs to clearly identify which process initiated the specific DNS request, thereby achieving fine-grained process-based management and policy enforcement of DNS traffic.

[0031] As a feasible implementation method, the target communication request is obtained by encapsulating the process information of the target process in the application into the original communication request, including: obtaining the process information of the target process and the original destination address of the communication request; wherein, the process information includes the identifier and / or name of the target process; and encapsulating the process information and the original destination address into the original communication request to obtain the target communication request.

[0032] In practice, the layered service provider obtains the process information of the target process by calling the operating system's application programming interface (API). Then, it encapsulates the process information and the original destination address of the communication request into the original communication request, forming a complete new data packet, i.e., the target communication request. Encapsulating the original destination address facilitates the subsequent proxy service program in determining the target server of the communication request during traffic processing. It is understandable that the process information and the original destination address can be written into certain free fields in the protocol header of the communication request, or the process information and protocol type can be encapsulated into a custom protocol header according to a predefined format and appended to the data payload of the communication request—either before or after the original protocol header.

[0033] S103: Redirect the target communication request to the proxy service program, and instruct the proxy service program to execute the corresponding traffic policy based on the process information.

[0034] The proxy service program is a background service program that runs on the local terminal and is used to receive and process communication requests.

[0035] In this step, the layered service provider modifies the destination address of the target communication request to the address and port of the proxy service program, redirecting the target communication request containing process information to the proxy service program. The proxy service program receives the target communication request redirected by the layered service provider, extracts the process information, and then processes the request according to preset policy rules. This process is completed entirely at the application layer, without the need to install or load kernel-level drivers, thus offering good system compatibility and ease of deployment.

[0036] The application traffic processing method provided in this application intercepts and redirects communication requests that meet preset conditions through a layered service provider within the application. This eliminates reliance on underlying drivers, avoiding issues such as driver loading failures or service dependencies, and improving system compatibility and deployment flexibility. When redirecting communication requests, the application actively adds process information, enabling the proxy service program to directly parse the process information corresponding to the request upon receipt and then process it promptly and accurately according to the preset traffic strategy. This mechanism ensures that traffic processing occurs at the application layer request initiation stage, overcoming the shortcomings of related technologies where driver layer delays prevent the timely acquisition of application layer traffic. Therefore, this application, through application-layer active marking and redirection, combined with real-time parsing and policy execution by the proxy service program, achieves early, accurate, and driver-independent traffic interception and processing, thereby improving system stability while ensuring the timely and effective execution of traffic strategies.

[0037] This application discloses a traffic processing method, in which the execution entity is a proxy service program in the terminal. Specifically: See Figure 2 A flowchart illustrating another traffic processing method according to an exemplary embodiment, such as... Figure 2 As shown, it includes: S201: Listen on a preset port on the local terminal; The preset port is a local network port pre-configured and bound by the proxy service program to receive redirected traffic. In this step, the proxy service program continuously listens on the preset port, and the layered service provider redirects target communication requests to the proxy service program through this preset port.

[0038] As a possible implementation, before the local terminal listens on the preset port, the method further includes: registering the dynamic link library of the layered service provider as a socket provider into the socket layered service provider chain of the operating system.

[0039] In Windows operating systems, the socket layered service provider chain is an ordered list of providers, and network requests are processed sequentially through each provider in the chain. When a proxy service program starts or installs, it registers information such as the dynamic link library file path and unique identifier of the layered service provider into this chain by calling a system-provided installation function. This registration is typically set to high priority for request processing. After successful registration, all communication requests from eligible applications will first pass through this custom provider when processed by the operating system's network stack, thus laying the foundation for unified traffic interception and redirection.

[0040] S202: Receive target communication request through preset port, wherein the target communication request is a request that is intercepted by the layered service program, encapsulated with process information, and then redirected to the preset port; In this step, the proxy service program receives target communication requests redirected by the application through a preset port.

[0041] S203: Perform protocol parsing on the target communication request to obtain the process information encapsulated in the target communication request; In this step, the proxy service program performs protocol parsing on the received target communication request and extracts process information, such as process identifier or process name.

[0042] S204: Execute the corresponding traffic policy based on the process information.

[0043] In this step, the proxy service program queries the pre-configured policy rule database based on the parsed process information, and performs corresponding traffic processing operations according to the matched policy rules.

[0044] As a feasible implementation method, the corresponding traffic policy is executed based on the process information, including: querying the corresponding policy rule based on the process information; if the policy rule is to allow, the process information encapsulated in the target communication request is stripped to obtain the original communication request, and the original communication request is directly forwarded to the target server based on the original destination address encapsulated in the target communication request; if the policy rule is to proxy forwarding, the process information encapsulated in the target communication request is stripped to obtain the original communication request, and the original communication request is forwarded to the target server through a preset proxy channel based on the original destination address encapsulated in the target communication request; if the policy rule is to block, the target communication request is discarded.

[0045] In practice, after receiving a redirected target communication request, the proxy service program queries a pre-configured policy rule table based on the parsed process identifier or name. This table defines the processing actions corresponding to different processes or process types. If the rule is to allow, the proxy service program removes the added process information, restores the original communication request, and sends it directly to the target server based on the original destination address of the original communication request. If the rule is to forward, after removing the process information, the original communication request is sent to the target server through a pre-defined specific network channel. For example, in a game acceleration scenario, the proxy service program can identify a communication request initiated by a game client based on process information, and then forward the communication request to the game server through a dedicated acceleration link to reduce network latency. If the rule is to block, the received target communication request is directly discarded without any network forwarding.

[0046] Therefore, this embodiment achieves accurate capture and identification of application-layer network traffic by receiving communication requests redirected by the layered service provider on a preset port on the local terminal. The proxy service program parses the process information encapsulated in the request, accurately associating traffic with its respective application without relying on deep packet inspection or kernel drivers. Based on the process information, the proxy service program can dynamically execute differentiated traffic policies, such as game acceleration, video speed limiting, or blocking of sensitive applications. Effective policy execution of traffic is achieved without relying on drivers.

[0047] The following describes an application embodiment of this application for accelerating game network traffic. For example... Figure 3 As shown, multiple applications are running on the computer, including game program A and game program B, as well as a decision program C that integrates traffic decision-making logic. The layered service provider exists as a dynamic link library and is available in both x64 and x86 versions depending on the system architecture.

[0048] During the initialization phase, decision program C registers the dynamic link library of the layered service provider as a socket provider into the socket layered service provider chain of the Windows operating system. This operation is completed in user mode through Windows system services, laying the system foundation for subsequent traffic interception.

[0049] When a user launches game program A or game program B, the operating system automatically loads the corresponding version of the Layered Service Provider Dynamic Link Library (LSP DDL) into the game process's memory space based on registration information. Network communication between game program A and game program B is initiated via the standard socket application programming interface, calling the system library WS2_32.dll. At this point, the loaded Layered Service Provider Dynamic Link Library intervenes in the network call process. Game program A or game program B obtains real-time traffic processing rules from decision-making program C through memory-mapped file communication. These rules determine which game traffic needs acceleration and which can connect directly.

[0050] LSP DDL is configured to handle a series of key network functions, including but not limited to WSPIoctl (input / output control), WSPConnect (establish connection), WSPSend (send data), WSPSendTo (send data to a specified target), WSPCloseSocket (close socket), and name service provider lookup functions such as NSPLookupServiceBegin, NSPLookupServiceNext, and NSPLookupServiceEnd. When game program A attempts to connect to the game server, its call to the WSPConnect function is intercepted by the layered service provider. After interception, the provider first obtains the process information of game program A. In particular, when the game program needs to resolve the domain name of the game server, its calls to domain name system-related functions (such as NSPLookupServiceBegin) are also intercepted, allowing the system to clearly know that the DNS query request was initiated by the process of game program A, thus achieving process-level tracing of DNS requests.

[0051] LSP DDL makes judgments based on rules obtained from the local proxy server. If TCP or UDP traffic initiated by game program A and destined for the game server is determined to require accelerated processing, the following operations are performed: A custom protocol header is added before the original connection request data, containing information such as the process identifier and process name of game program A; then, the destination address of the modified request packet is redirected to decision program C. Decision program C integrates traffic decision logic. If it determines that a certain traffic does not require special processing (e.g., update requests from the game client or non-game traffic), it allows it to pass through and transmits it along the normal network path. If it determines that a certain traffic (e.g., game traffic) is involved, it forwards it to the final game server through a preset, optimized low-latency, high-bandwidth proxy channel (such as a dedicated game acceleration network line).

[0052] As can be seen, this embodiment intercepts and identifies game traffic at the application layer early by using a layered service provider. Combined with the intelligent routing of the local proxy server (i.e., decision program C), it achieves precise acceleration of game network connections and DNS resolution requests, effectively reducing game latency and packet loss rate, while avoiding compatibility and stability issues caused by installing kernel drivers.

[0053] This application provides an electronic device. Figure 4 This is a structural diagram of an electronic device according to an exemplary embodiment, such as... Figure 4 As shown, the electronic device includes: Communication interface 1 enables information exchange with other devices, such as network devices; Processor 2 is connected to communication interface 1 to enable information exchange with other devices and, when running a computer program, executes the traffic processing methods provided by one or more of the above-mentioned technical solutions. The computer program is stored in memory 3.

[0054] Of course, in practical applications, the various components in an electronic device are coupled together through bus system 4. It can be understood that bus system 4 is used to achieve communication and connection between these components. In addition to the data bus, bus system 4 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 4 The general will label all buses as Bus System 4.

[0055] The memory 3 in this embodiment is used to store various types of data to support the operation of the electronic device. Examples of such data include any computer program used to operate on the electronic device.

[0056] It is understood that memory 3 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory 3 described in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0057] The methods disclosed in the embodiments of this application can be applied to processor 2, or implemented by processor 2. Processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 2 or by instructions in the form of software. The processor 2 may be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 2 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory 3. Processor 2 reads the program in memory 3 and completes the steps of the aforementioned method in combination with its hardware.

[0058] When processor 2 executes the program, it implements the corresponding processes in the various methods of the embodiments of this application. For the sake of brevity, these will not be described in detail here.

[0059] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory 3 that stores a computer program, which can be executed by a processor 2 to complete the steps described in the aforementioned method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.

[0060] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0061] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0062] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A method of processing program traffic, characterized by, Applied to a terminal that loads a layered service provider, the method includes: The layered service provider intercepts the original communication requests initiated by the application; When the original communication request meets the preset conditions, the process information of the target process in the application is encapsulated into the original communication request to obtain the target communication request; wherein, the target process is the process that initiated the original communication request; The target communication request is redirected to the proxy service program, which is then instructed to execute the corresponding traffic policy based on the process information.

2. The program traffic processing method according to claim 1, characterized in that, Before intercepting the original communication request initiated by the application through the layered service provider, the method further includes: Load the dynamic link library corresponding to the layered service provider into the process space of the application.

3. The program traffic processing method according to claim 1, characterized in that, The preset condition includes a preset function, which includes any one or a combination of any of the following: connection control function, socket connection establishment function, data sending function, socket closing function, and name service provider query function.

4. The program traffic processing method according to claim 1, characterized in that, Encapsulating the process information of the target process in the application into the original communication request to obtain the target communication request includes: Obtain the process information of the target process and the original destination address of the original communication request; wherein, the process information includes the identifier and / or name of the target process; The process information and the original destination address are encapsulated into the original communication request to obtain the target communication request.

5. A method for processing program traffic, characterized in that, The method, which is applied to a proxy service program in a terminal, includes: Listen on a preset port in the local terminal; The target communication request is received through the preset port, wherein the target communication request is a request that is intercepted by the layered service program, encapsulated with process information, and then redirected to the preset port; The target communication request is parsed to obtain the process information encapsulated in the target communication request; The corresponding traffic strategy is executed based on the process information.

6. The program traffic processing method according to claim 5, characterized in that, Before listening on the preset port on the local terminal, the process also includes: The dynamic link library of the layered service provider is registered as a socket provider in the operating system's socket layered service provider chain.

7. The program traffic processing method according to claim 5, characterized in that, The step of executing the corresponding traffic strategy based on the process information includes: Query the corresponding policy rules based on the process information; If the policy rule is to allow, the process information encapsulated in the target communication request is stripped to obtain the original communication request, and based on the original destination address encapsulated in the target communication request, the original communication request is directly forwarded to the target server. If the policy rule is proxy forwarding, the process information encapsulated in the target communication request is stripped to obtain the original communication request, and based on the original destination address encapsulated in the target communication request, the original communication request is forwarded to the target server through a preset proxy channel; If the policy rule is to block, then the target communication request is discarded.

8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the program traffic processing method as described in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the steps of the program traffic processing method as described in any one of claims 1 to 7.

10. A computer program product, characterized in that, It includes a computer program that, when executed, implements the steps of the program traffic processing method as described in any one of claims 1 to 7.