Network request processing method and device, equipment and storage medium

By modifying the source code of the operating system, marking and capturing the network data of the designated application software, the problem of not being able to identify the source of network data in the prior art is solved, and network data capture and statistical analysis of the designated application software is realized.

CN119071184APending Publication Date: 2024-12-03JINGDONG TECH HLDG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411355375.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The prior art cannot identify the source of network data, and cannot realize network data capture and statistical analysis of specified application software.

Method used

通过修改操作系统的源码,获取并标记网络数据的来源,实现对指定应用软件的网络数据捕获和统计分析。

Benefits of technology

The network data capture and statistical analysis of the specified application software is realized, and the network data of the specified application software can be identified and filtered out, solving the problem that omni-channel data capture cannot be identified in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119071184A_ABST
    Figure CN119071184A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a network request processing method and device, equipment and a storage medium, and relates to the technical field of computers, the method can be applied to terminal equipment, and the method comprises the following steps: in response to a network request initiated by target application software, determining a reconfiguration request processing function corresponding to the network request; the reconfiguration request processing function is a request processing function obtained by modifying an original request processing function of an operating system installed in the terminal equipment in advance; executing the following operations by calling a reconfiguration request processing function corresponding to the network request: obtaining network data carried by the network request and a software identifier of target application software; and performing data storage on the acquired network data based on the software identifier, and performing data processing on the acquired network data. By adopting the technical scheme of the embodiment of the invention, the capture of the network data of the specified application software can be realized, so that the network data of the specified application software can be conveniently subjected to statistical analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a method, device, equipment and storage medium for processing a network request. Background Art

[0002] At present, in order to facilitate network management and improve network security, network data can be captured and analyzed (that is, network traffic monitoring) for the captured network data. In the prior art, network data can be captured by intercepting data packets transmitted in the network through network packet capture and analysis tools; or, network data can be captured by network proxy (for example, by changing the configuration of the client so that the network request initiated by the client is directly sent to the proxy server).

[0003] However, in the process of implementing the present invention, it was found that there are at least the following problems in the prior art: the network data capture solution provided by the prior art captures network data from all channels and cannot identify the source of the network data. In this way, it is impossible to capture the network data of a specified application software (Application, APP). Summary of the invention

[0004] The embodiments of the present invention provide a method, device, equipment and storage medium for processing a network request, which can realize the capture of network data of a specified application software so as to perform statistical analysis on the network data of the specified application software.

[0005] In a first aspect, an embodiment of the present invention provides a method for processing a network request, which can be applied to a terminal device, and the method may include: in response to a network request initiated by a target application software, determining a reconfiguration request processing function corresponding to the network request; wherein the reconfiguration request processing function is a request processing function obtained by pre-modifying an original request processing function of an operating system installed in the terminal device; performing the following operations by calling the reconfiguration request processing function corresponding to the network request: obtaining network data carried by the network request and a software identifier of the target application software; performing data storage on the obtained network data based on the software identifier, and performing data processing on the obtained network data.

[0006] In a second aspect, an embodiment of the present invention further provides a network request processing device, which can be configured in a terminal device, and the device may include: a determination module and a processing module;

[0007] Specifically, the determination module is used to respond to the network request initiated by the target application software and determine the reconfiguration request processing function corresponding to the network request; wherein the reconfiguration request processing function is a request processing function obtained by pre-modifying the original request processing function of the operating system installed in the terminal device; the processing module is used to perform the following operations by calling the reconfiguration request processing function corresponding to the network request: obtaining the network data carried by the network request and the software identifier of the target application software; performing data storage on the obtained network data based on the software identifier, and performing data processing on the obtained network data.

[0008] In a third aspect, an embodiment of the present invention provides a network request processing device, the network request processing device comprising:

[0009] one or more processors;

[0010] A memory for storing one or more programs;

[0011] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing network requests provided by any embodiment of the present invention.

[0012] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for processing a network request as provided in any embodiment of the present invention.

[0013] The embodiments of the above invention have the following advantages or beneficial effects:

[0014] In the technical solution provided by the embodiment of the present invention, the part corresponding to the basic function for processing network requests at the bottom layer (i.e., the original request processing function in the embodiment of the present invention) in the source code of the operating system can be modified in advance, so that the modified original request processing function (i.e., the reconfiguration request processing function in the embodiment of the present invention) not only has the function of the original request processing function (i.e., obtaining the network data in the network request, and further processing the obtained network data according to the request information of the network request), but also has the following functions: before processing the obtained network data, copy and store the obtained network data; and when copying and storing the obtained network data, mark the source of the network data (i.e., copy and store the obtained network data based on the software identifier of the application software that generates the network data). Afterwards, when the terminal device is running the operating system with modified source code, if a network request initiated by the target application software is detected, the reconfiguration request processing function corresponding to the network request can be called to process the network request. Specifically, the network data carried by the network request and the software identifier of the target application software can be obtained first; then the obtained network data is stored based on the software identifier, and the obtained network data is processed.

[0015] Since the application software will eventually call the basic function for processing the network request at the bottom layer of the operating system after initiating the network request, and the request information of the network request will mark the initiator of the network request (characterized by the software identifier of the application software), based on this, the embodiment of the present invention adopts the method of directly modifying the source code of the operating system to realize the capture of the network data of the specified application software. Specifically, by modifying the part corresponding to the basic function for processing the network request at the bottom layer in the source code of the operating system, it is possible to capture the network data in the process of processing the network request; and it is also possible to mark the source of the network data based on the software identifier in the process of capturing the network data. In this way, when performing statistical analysis on the captured network data, the network data of the specified application software can be filtered out from the captured network data based on the source of the marked network data, thereby realizing the statistical analysis of the network data of the specified application software. It can be seen that the technical solution provided by the embodiment of the present invention can realize the capture of the network data of the specified application software by modifying the source code of the operating system, thereby facilitating the statistical analysis of the network data of the specified application software. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a flowchart of a method for processing a network request provided by an embodiment of the present invention;

[0017] Figure 2It is a flowchart of another method for processing a network request provided by an embodiment of the present invention;

[0018] Figure 3 It is a flowchart of another method for processing a network request provided by an embodiment of the present invention;

[0019] Figure 4 It is a structural diagram of a network request processing device provided by an embodiment of the present invention;

[0020] Figure 5 It is a structural diagram of a network request processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0021] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0022] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0023] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of the embodiments of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.

[0024] It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0025] In the description of the embodiments of the present invention, unless otherwise specified, “plurality” or “each” means two or more than two.

[0026] Figure 1A flowchart of a method for processing a network request provided in an embodiment of the present invention, the method can be applicable to application scenarios where network data needs to be captured. The method can be executed by a network request processing device provided in an embodiment of the present invention, the device can be implemented in software and / or hardware, and integrated in a network request processing device. Specifically, the network request processing device integrated with the network request processing device can be a terminal device. Exemplarily, the terminal device can be different types of mobile terminals such as a mobile phone, a tablet computer, an ultra-mobile personal computer (UMPC), a handheld computer, a wearable electronic device, a virtual reality device, etc.

[0027] like Figure 1 As shown, the method for processing a network request provided by an embodiment of the present invention specifically includes the following steps:

[0028] S110 . In response to a network request initiated by the target application software, determine a reconfiguration request processing function corresponding to the network request.

[0029] The method for processing network requests provided in the embodiment of the present invention can be applied to a terminal device, and the target application software can be various types of application software installed in the terminal device. In a possible implementation, during the operation of the target application software, it can initiate a network request to the terminal device in response to the operation performed by the user in the application interface of the target application software. Taking the target application software as an example, when the user wants to use the image editing function provided by the image editing application software, the target image to be edited can be uploaded to the image editing application software; for example, the user can trigger the image editing application software to initiate a network request to the terminal device by selecting the upload control in the application interface of the image editing application software, and the network request is used to store the target image uploaded by the user in the memory space of the terminal device.

[0030] The reconfigured request processing function is a request processing function obtained by pre-modifying the original request processing function of the operating system installed in the terminal device; the original request processing function is the lowest-level basic function for processing network requests in the source code of the operating system. Exemplarily, the source code of the operating system can be the Android Open Source Project (AOSP) source code, etc. For example, the original request processing function can be a read function (a system function for reading file content and successfully returning the number of bytes read) or a write function (a system function for writing data from a buffer to a file).

[0031] The terminal device is installed with an operating system, which is the core software of the computer system and is used to manage the hardware resources of the terminal device and provide a running environment and interface for the target application software installed in the terminal device. The target application software relies on the interface and service provided by the operating system to implement specific functions. In the prior art, after the target application software initiates a network request to the terminal device, it will call the original request processing function corresponding to the network request in the operating system in various ways (in actual applications, it can be indirectly called through a series of other functions, rather than directly called). For example, it can be called through the application programming interface (Application Programming Interface, API) provided by the operating system. After being called, the original request processing function can implement the following functions: obtain the network data in the network request, and process the network data according to the request information carried by the network request. In the embodiment of the present invention, in order to realize the capture of the network data of the specified application software, the original request processing function can be modified so that the modified reconfiguration request processing function not only has the function of the original request processing function, but also has the function of capturing the network data of the specified application software. In this way, when the target application software initiates a network request to the terminal device, the reconfiguration request processing function corresponding to the network request will be called, so that the network data of the specified application software can be captured while processing the network request through the reconfiguration request processing function corresponding to the network request.

[0032] Optionally, in response to a network request initiated by the target application software, before determining the reconfiguration request processing function corresponding to the network request, the network request processing method provided by an embodiment of the present invention also includes: obtaining each original request processing function; for each original request processing function, in response to a code implantation operation on the current original request processing function, modifying the current original request processing function to a reconfiguration request processing function corresponding to the current original request processing function; based on the reconfiguration request processing functions corresponding to each original request processing function, modifying the source code of the operating system, recompiling the modified source code, and installing the recompiled executable file.

[0033] In a possible implementation, the developer can first import the source code of the operating system into a terminal device installed with the compiled software (the terminal device can be a terminal device installed with the target application software, or other terminal devices, and the embodiments of the present invention are referred to as the target terminal device in the following description), and then find the suspected code that may be the corresponding part of the original request processing function in the source code of the imported operating system displayed on the target terminal device, and add some logs at the corresponding position of the suspected code. These logs are used to record the execution information of the suspected code. After that, the developer can recompile the source code of the operating system with the log added in the target terminal device, and install the recompiled executable file in the target terminal device. Then, the developer can trigger the application software installed in the target terminal device, and test whether the suspected code is the corresponding part of the original request processing function according to the execution information recorded in the log. After the developer has tested the code portion of the real original request processing function, the code portion of the real original request processing function can be stored at a specified address. When there is a need to capture network data of the target application software installed in the terminal device, the code portion of the real original request processing function stored at the specified address can be uploaded to the terminal device installed with the target application software. After uploading the code portion of the real original request processing function to the terminal device installed with the target application software, the uploaded original request processing function can be implanted in the terminal device installed with the target application software to modify the original request processing function to the corresponding reconfiguration request processing function, and then the original request processing function in the source code of the operating system is replaced with the reconfiguration request processing function, and the modified source code is recompiled, and the recompiled executable file is installed.

[0034] In another possible implementation, the developer may also directly perform a code implantation operation on the original request processing function in the target terminal device, and finally obtain a recompiled executable file. Afterwards, the recompiled executable file may be stored. When there is a need to capture network data of the target application software installed in the terminal device, the previously stored recompiled executable file may be obtained and directly installed in the terminal device.

[0035] Among them, different original request processing functions correspond to different request protocol types, or correspond to different data request types. That is, before the source code of the operating system is modified, network requests of different request protocol types will call different original request processing functions, and network requests of different data request types will call different original request processing functions. Exemplarily, the request protocol type may include various protocol types such as Hypertext Transfer Protocol (HTTP), Hypertext Transfer Protocol Secure (HTTPS), Message Queuing Telemetry Transport (MQTT) protocol, and Transmission Control Protocol (TCP). The data request type may include a data receiving type (a data receiving type network request is used to read file content) and a data sending type (a data sending type network request is used to write file content).

[0036] Because before modifying the source code of the operating system, network requests of different request protocol types will call different original request processing functions, and network requests of different data request types will also call different original request processing functions. Therefore, in the embodiment of the present invention, when modifying the source code of the operating system, it is necessary to perform code modification operations on the original request processing functions corresponding to the various request protocol types and the original request processing functions corresponding to the various data request types.

[0037] In addition, in order to ensure that after the original request processing function is modified, the reconfigured request processing function still has the functions of the original request processing function, the modification of the original request processing function can be achieved by performing a code implantation operation on the original request processing function. In this way, it can be ensured that while capturing the network data of the specified application software, the normal operation of the operating system is not affected, and the operating system can process the network request normally. Exemplarily, the developer can implant a piece of code in each original request processing function, and the implanted code is used to realize the function of capturing the network data of the specified application software.

[0038] In addition, after the source code of the operating system is modified based on the reconfigured request processing functions corresponding to each original request processing function, in order to enable the terminal device to normally run the operating system with the modified source code, the modified source code can be recompiled and the recompiled executable file can be installed to the terminal device.

[0039] S120, performing the following operations by calling the reconfiguration request processing function corresponding to the network request: obtaining the network data carried by the network request and the software identifier of the target application software; storing the obtained network data based on the software identifier, and performing data processing on the obtained network data.

[0040] After being called, the original request processing function can be used to obtain network data in the network request and process the network data according to the request information carried by the network request. In the embodiment of the present invention, in order to realize the capture of network data, the function of the reconfiguration request processing function corresponding to the network request can be configured to copy and store the acquired network data before processing the acquired network data.

[0041] In one possible implementation, the acquired network data may be stored in the local memory of the terminal device. When the user needs to perform statistical analysis on the captured network data, the captured network data may be searched in the local memory of the terminal device, thereby performing statistical analysis on the found network data. In another possible implementation, the acquired network data may be uploaded to a predetermined storage server. When the user needs to perform statistical analysis on the captured network data, the storage server may be accessed through various mobile terminals to acquire the captured network data from the storage server.

[0042] In addition, in the embodiment of the present invention, in order to realize the capture of the network data of the specified application software, the function of the reconfiguration request processing function corresponding to the network request can also be configured to copy and store the acquired network data based on the software identifier of the application software that generates the network data when copying and storing the acquired network data. In this way, when the acquired network data is copied and stored, the source of the network data is marked. When the user has the need to perform statistical analysis on the network data of a certain application software, the network data corresponding to the software identifier can be found from the captured global network data based on the software identifier of the application software, thereby realizing statistical analysis of the network data of the application software.

[0043] Optionally, data storage of the acquired network data is performed based on the software identifier, including: uploading the acquired network data to a preset storage address based on the software identifier; and when a data query request is detected, acquiring target data from the preset storage address based on a request field carried by the data query request.

[0044] The preset storage address may be a predetermined memory address of a terminal device, or may be a predetermined address of a storage server. The request fields carried by the data query request may include a query time field, a query identification field, etc. The query time field may represent the time period to be counted, and the query identification field may represent the software identification of the application software to be counted.

[0045] Since the source of the network data is marked based on the software identifier in the process of capturing the network data, the embodiment of the present invention can also provide the user with a function of querying the network data of the specified application software. Specifically, the user can query the network data of the specified application software stored in the preset storage address within the specified time period by entering the query time field, the query identifier field and other request fields in the terminal device, so as to perform statistical analysis on the queried network data.

[0046] In the network request processing method provided in the embodiment of the present invention, the part corresponding to the bottom-level basic function for processing network requests (i.e., the original request processing function in the embodiment of the present invention) in the source code of the operating system can be modified in advance, so that the modified original request processing function (i.e., the reconfiguration request processing function in the embodiment of the present invention) not only has the function of the original request processing function (i.e., obtaining the network data in the network request, and further processing the obtained network data according to the request information of the network request), but also has the following functions: before processing the obtained network data, copy and store the obtained network data; and when copying and storing the obtained network data, mark the source of the network data (i.e., copy and store the obtained network data based on the software identifier of the application software that generates the network data). Afterwards, when the terminal device is running the operating system with the modified source code, if a network request initiated by the target application software is detected, the reconfiguration request processing function corresponding to the network request can be called to process the network request. Specifically, the network data carried by the network request and the software identifier of the target application software may be obtained first; then the obtained network data may be stored based on the software identifier, and the obtained network data may be processed.

[0047] Since the application software will eventually call the basic function for processing the network request at the bottom layer of the operating system after initiating the network request, and the request information of the network request will mark the initiator of the network request (characterized by the software identifier of the application software), based on this, the embodiment of the present invention adopts the method of directly modifying the source code of the operating system to realize the capture of the network data of the specified application software. Specifically, by modifying the part corresponding to the basic function for processing the network request at the bottom layer in the source code of the operating system, it is possible to capture the network data in the process of processing the network request; and it is also possible to mark the source of the network data based on the software identifier in the process of capturing the network data. In this way, when performing statistical analysis on the captured network data, the network data of the specified application software can be filtered out from the captured network data based on the source of the marked network data, thereby realizing the statistical analysis of the network data of the specified application software. It can be seen that the technical solution provided by the embodiment of the present invention can realize the capture of the network data of the specified application software by modifying the source code of the operating system, thereby facilitating the statistical analysis of the network data of the specified application software.

[0048] Reference Figure 2 , is a flow chart of another method for processing network requests provided by an embodiment of the present invention. The method in this embodiment can be combined with various optional solutions in the method for processing network requests provided by the previous embodiment, and the method for processing network requests provided by the previous embodiment is further optimized. Figure 2 As shown, the specific steps include:

[0049] S210. In response to a network request initiated by the target application software, based on a request protocol type of the network request and a data request type corresponding to the network request, determine a reconfiguration request processing function corresponding to the network request from various reconfiguration request processing functions.

[0050] Taking the case where the request protocol types include HTTP type and HTTPS type, and the data request types include data receiving type (corresponding to read function) and data sending type (corresponding to write function) as an example, in an embodiment of the present invention, the original request processing functions such as the read function corresponding to the HTTP type, the write function corresponding to the HTTP type, the read function corresponding to the HTTPS type, and the write function corresponding to the HTTPS type can be modified to obtain various reconfiguration request processing functions. When the target application software initiates a network request, the corresponding reconfiguration request processing function can be determined from various reconfiguration request processing functions based on the request protocol type of the network request and the data request type corresponding to the network request.

[0051] In addition, in actual applications, each original request processing function may include request processing functions defined in different programming languages, for example, it may include request processing functions defined in programming languages ​​such as Java (an object-oriented programming language) and C (a programming language). Based on this, in an embodiment of the present invention, it is also necessary to modify the original request processing functions in different programming languages ​​to obtain the corresponding reconfigured request processing functions. Optionally, since the original request processing function defined in the Java language will eventually call the original request processing function defined in the C language, when each original request processing function includes original request processing functions defined in the Java language and the C language, it is only necessary to modify the original request processing function defined in the C language.

[0052] S220, performing the following operations by calling the reconfiguration request processing function corresponding to the network request: obtaining the network data carried by the network request and the software identifier of the target application software; storing the obtained network data based on the software identifier, and performing data processing on the obtained network data.

[0053] Optionally, the acquired network data is data stored and data processed based on the software identifier, including: when the data request type is a data sending type, the acquired network data is data stored based on the software identifier, the acquired network data is encrypted, and the encrypted network data is sent; when the data request type is a data receiving type, the acquired network data is decrypted, the decrypted network data is data stored based on the software identifier, and the decrypted network data is received.

[0054] Existing solutions for capturing network data can only capture network data transmitted in plain text without the support of digital certificates, but cannot capture network data transmitted in encrypted form. For example, a capture solution based on a network proxy cannot capture network data transmitted based on the HTTPS protocol without the support of a Secure Socket Layer (SSL) digital certificate. Alternatively, even with the support of a digital certificate, if the target application software has enabled local certificate verification, it still cannot capture network data transmitted based on the HTTPS protocol. In view of the problem that there are limitations in capturing encrypted network data in the existing network data capture solutions, the embodiments of the present invention also achieve the capture of encrypted network data by modifying the source code of the operating system.

[0055] Specifically, for the original request processing function, when processing a data sending type network request, it generally encrypts the network data before sending the network data; based on this, in the embodiment of the present invention, the original request processing function corresponding to the data sending type can be modified so that the modified reconfiguration request processing function can copy and store the acquired network data before encrypting the network data. Similarly, for the original request processing function, when processing a data receiving type network request, it generally decrypts the network data before receiving the network data; based on this, in the embodiment of the present invention, the original request processing function corresponding to the data receiving type can be modified so that the modified reconfiguration request processing function can copy and store the decrypted network data after decrypting the network data. In this way, no matter whether the target application software initiates a data sending type or a data receiving type network request, the network data captured by calling the reconfiguration request processing function corresponding to the network request are all plain text data. It can be seen that the network data capture scheme provided in the embodiment of the present invention can realize the capture of non-plain text transmission network data without the support of digital certificates.

[0056] In the embodiment of the present invention, on the basis of the above-mentioned embodiment, before the source code of the operating system is modified, the network requests of different request protocol types initiated by the target application software will call different original request processing functions, and the network requests of different data request types initiated by the target application software will also call different original request processing functions. Based on this, in the embodiment of the present invention, when the source code of the operating system is modified, the original request processing functions corresponding to different request protocol types and the original request processing functions corresponding to different data request types are modified. In this way, when the target application software initiates a network request, the following functions are first implemented through other functions: based on the request protocol type of the network request and the data request type corresponding to the network request, each reconfiguration request processing function is determined from the modified source code, and the reconfiguration request processing function corresponding to the request protocol type and data request type of the network request is determined from each reconfiguration request processing function; then, the reconfiguration request processing function corresponding to the network request is called to realize the function of capturing the network data of the specified application software.

[0057] In addition, the existing capture solution based on network proxy requires that the network of the terminal device and the network of the proxy server are in the same local area network, which has certain limitations. However, the capture solution provided by the embodiment of the present invention does not have this limitation and can be widely used.

[0058] It should be noted that the network request processing method proposed in the embodiment of the present invention and the aforementioned embodiment belongs to the same inventive concept, and the technical details not fully described in this embodiment can be referred to the aforementioned embodiment, and the beneficial effects of the aforementioned embodiment are also applicable to this embodiment.

[0059] Reference Figure 3 , is a flow chart of another method for processing network requests provided by an embodiment of the present invention. The method in this embodiment can be combined with various optional solutions in the method for processing network requests provided by the previous embodiment, and the method for processing network requests provided by the previous embodiment is further optimized. Figure 3 As shown, the specific steps include:

[0060] S310 . In response to a network request initiated by a target application software, determine a reconfiguration request processing function corresponding to the network request.

[0061] S320, performing the following operations by calling the reconfiguration request processing function corresponding to the network request: obtaining the network data carried by the network request and the software identifier of the target application software; based on the software identifier, adding the obtained network data to the pre-created target queue, parsing and processing the network data in the target queue through an asynchronous thread for the target queue, and storing the parsed network data; performing data processing on the obtained network data through the main thread.

[0062] In a possible implementation, after acquiring the network data carried by the network request and the software identifier of the target application software by calling the reconfiguration request processing function, the field corresponding to the software identifier of the target application software can be added to the acquired network data, and the network data after the field addition processing is inserted into the pre-created target queue. In addition, the embodiment of the present invention pre-starts an asynchronous thread for the target queue, and the asynchronous thread is used to acquire the network data inserted into the target queue based on the queue order of the target queue, and parses the network data acquired from the target queue, and then stores the parsed network data.

[0063] Exemplarily, after the asynchronous thread obtains certain network data from the target queue, it can first determine the request protocol type corresponding to the network request from which the network data originates based on the protocol header of the network data, and then parse the network data according to the protocol conversion rules corresponding to the request protocol type.

[0064] Optionally, based on the software identifier, the acquired network data is added to a pre-created target queue, including: based on the data request type corresponding to the network request, determining the target queue from the pre-created candidate queues, and adding the acquired network data to the target queue based on the software identifier.

[0065] Among them, different data request types correspond to different candidate queues.

[0066] In an embodiment of the present invention, corresponding candidate queues can be created for data receiving type network requests and data sending type network requests. Furthermore, by calling the reconfiguration request processing function corresponding to the network request, the network data obtained from the data receiving type network request is added to the candidate queue corresponding to the data receiving type network request, and the network data obtained from the data sending type network request is added to the candidate queue corresponding to the data sending type network request. In this way, the separate storage of the sending traffic and the receiving traffic can be realized, which can facilitate the user to perform statistical analysis on the sending traffic and the receiving traffic of the target application software respectively.

[0067] Optionally, based on the software identifier, the acquired network data is added to a pre-created target queue, including: based on the software identifier and the data request type corresponding to the network request, performing identifier-adding processing on the acquired network data, and adding the network data after the identifier-adding processing to the target queue.

[0068] Exemplarily, after acquiring network data by calling the reconfiguration request processing function, a field corresponding to the software identifier of the target application software and a field corresponding to the data request type of the network request can be added to the acquired network data (different fields can be determined in advance for different data request types). Thereafter, the network data after the field addition processing is inserted into a pre-created target queue.

[0069] In the embodiment of the present invention, the sent traffic and received traffic can be marked by adding a field corresponding to the data request type of the network request to the acquired network data, so that the user can perform statistical analysis on the sent traffic and received traffic of the target application software.

[0070] In an embodiment of the present invention, on the basis of the aforementioned embodiment, since the network data captured by calling the reconfiguration request processing function is network data based on a computer language, that is, unreadable bytes, after capturing the network data by calling the reconfiguration request processing function, the captured network data needs to be parsed and processed to convert the unreadable bytes into readable information. If the captured network data is processed by the main thread and the captured network data is parsed at the same time, the data processing speed of the acquired network data will be affected. Based on this, in an embodiment of the present invention, a queue for storing acquired network data can be created in advance, and an asynchronous thread can be started for the queue, and the network data stored in the queue can be parsed and processed by the asynchronous thread. In this way, while capturing the network data of the specified application software, the main thread can be prevented from being blocked due to the parsing of the captured network data.

[0071] It should be noted that the network request processing method proposed in the embodiment of the present invention and the aforementioned embodiment belongs to the same inventive concept, and the technical details not fully described in this embodiment can be referred to the aforementioned embodiment, and the beneficial effects of the aforementioned embodiment are also applicable to this embodiment.

[0072] Figure 4 A schematic diagram of the structure of a network request processing device provided by an embodiment of the present invention, the device includes: a determination module 410 and a processing module 420.

[0073] Exemplarily, the determination module 410 may execute S110 in the above method embodiment, and the processing module 420 may execute S120 in the above method embodiment.

[0074] Specifically, the determination module 410 is used to respond to the network request initiated by the target application software and determine the reconfiguration request processing function corresponding to the network request; wherein the reconfiguration request processing function is a request processing function obtained by pre-modifying the original request processing function of the operating system installed in the terminal device; the processing module 420 is used to perform the following operations by calling the reconfiguration request processing function corresponding to the network request: obtaining the network data carried by the network request and the software identifier of the target application software; performing data storage on the obtained network data based on the software identifier, and performing data processing on the obtained network data.

[0075] Optionally, in a possible implementation manner, the determining module 410 is specifically configured to:

[0076] In response to the network request, based on the request protocol type of the network request and the data request type corresponding to the network request, a reconfiguration request processing function corresponding to the network request is determined from various reconfiguration request processing functions; wherein the data request type includes a data receiving type and a data sending type.

[0077] Optionally, in another possible implementation manner, the processing module 420 is specifically configured to:

[0078] In the case where the data request type is a data sending type, the acquired network data is stored based on the software identifier, the acquired network data is encrypted, and the encrypted network data is sent;

[0079] In the case where the data request type is a data receiving type, the acquired network data is decrypted, the decrypted network data is stored based on the software identifier, and the decrypted network data is received.

[0080] Optionally, in another possible implementation manner, the processing module 420 is further configured to:

[0081] Based on the software identifier, the acquired network data is added to a pre-created target queue, so as to parse and process the network data in the target queue through an asynchronous thread for the target queue, and store the parsed network data;

[0082] The main thread is used to process the acquired network data.

[0083] Optionally, in another possible implementation manner, the processing module 420 is further configured to:

[0084] Based on the data request type corresponding to the network request, determine the target queue from the pre-created candidate queues, and add the acquired network data to the target queue based on the software identifier;

[0085] Among them, different data request types correspond to different candidate queues.

[0086] Optionally, in another possible implementation manner, the processing module 420 is further configured to:

[0087] Based on the software identifier and the data request type corresponding to the network request, the obtained network data is subjected to identifier adding processing, and the network data subjected to identifier adding processing is added to the target queue.

[0088] Optionally, in another possible implementation manner, the processing module 420 is further configured to:

[0089] Uploading the acquired network data to a preset storage address based on the software identification;

[0090] When a data query request is detected, target data is acquired from a preset storage address based on a request field carried in the data query request.

[0091] Optionally, in another possible implementation, the network request processing device further includes an acquisition module, a modification module, and a system installation module;

[0092] an acquisition module, configured to acquire each original request processing function before the determination module 410 determines the reconfiguration request processing function corresponding to the network request in response to the network request initiated by the target application software; different original request processing functions correspond to different request protocol types or to different data request types;

[0093] A modification module, for modifying, for each original request processing function, the current original request processing function into a reconfigured request processing function corresponding to the current original request processing function in response to a code implantation operation on the current original request processing function;

[0094] The system installation module is used to modify the source code of the operating system based on the reconfigured request processing functions corresponding to the original request processing functions, recompile the modified source code, and install the recompiled executable file.

[0095] The network request processing device provided in the embodiment of the present invention belongs to the same inventive concept as the network request processing method provided in the aforementioned embodiments. For details not fully described in the embodiment of the network request processing device, reference can be made to the relevant contents of the aforementioned method embodiments, and the corresponding beneficial effects can also be referred to the beneficial effect analysis of the aforementioned method embodiments.

[0096] Figure 5 A schematic diagram of the structure of a network request processing device provided in an embodiment of the present invention, wherein the network request processing device may be a terminal device. Figure 5 A block diagram of an exemplary network request processing device 12 suitable for implementing embodiments of the present invention is shown. Figure 5 The network request processing device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0097] like Figure 5 As shown, the network request processing device 12 is in the form of a general-purpose computing device. The components of the network request processing device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).

[0098] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0099] The network request processing device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the network request processing device 12, including volatile and non-volatile media, removable and non-removable media.

[0100] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory (i.e., Figure 5 The network request processing device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0101] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0102] The network request processing device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the network request processing device 12, and / or any device that enables the network request processing device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. In addition, the network request processing device 12 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) through a network adapter 20. Figure 5 As shown, the network adapter 20 communicates with other modules of the network request processing device 12 via the bus 18. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with the network request processing device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0103] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, such as implementing the steps of the network request processing method provided in the embodiment of the present invention, the method comprising: responding to the network request initiated by the target application software, determining the reconfiguration request processing function corresponding to the network request; wherein the reconfiguration request processing function is a request processing function obtained by pre-modifying the original request processing function of the operating system installed in the terminal device; performing the following operations by calling the reconfiguration request processing function corresponding to the network request: obtaining the network data carried by the network request and the software identifier of the target application software; performing data storage on the obtained network data based on the software identifier, and performing data processing on the obtained network data.

[0104] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the method for processing network requests provided by any embodiment of the present invention.

[0105] The present embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of a method for processing a network request as provided in the aforementioned embodiment of the present invention are implemented. The method comprises: in response to a network request initiated by a target application software, determining a reconfiguration request processing function corresponding to the network request; wherein the reconfiguration request processing function is a request processing function obtained by pre-modifying an original request processing function of an operating system installed in a terminal device; performing the following operations by calling the reconfiguration request processing function corresponding to the network request: obtaining network data carried by the network request and a software identifier of the target application software; performing data storage on the obtained network data based on the software identifier, and performing data processing on the obtained network data.

[0106] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0107] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0108] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0109] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or a processing device requested by a network. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0110] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0111] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for processing a network request, characterized in that: Applied to a terminal device, the method comprises: In response to a network request initiated by the target application software, determining a reconfiguration request processing function corresponding to the network request; wherein the reconfiguration request processing function is a request processing function obtained by pre-modifying an original request processing function of the operating system installed in the terminal device; The following operations are performed by calling the reconfiguration request processing function corresponding to the network request: obtaining the network data carried by the network request and the software identifier of the target application software; storing the obtained network data based on the software identifier, and processing the obtained network data.

2. The method for processing a network request according to claim 1, characterized in that: The step of determining, in response to a network request initiated by the target application software, a reconfiguration request processing function corresponding to the network request comprises: In response to the network request, based on the request protocol type of the network request and the data request type corresponding to the network request, a reconfiguration request processing function corresponding to the network request is determined from various reconfiguration request processing functions; wherein the data request type includes a data receiving type and a data sending type.

3. The method for processing a network request according to claim 2, characterized in that: The storing the acquired network data based on the software identifier and processing the acquired network data includes: In the case where the data request type is the data sending type, storing the acquired network data based on the software identifier, encrypting the acquired network data, and sending the encrypted network data; In the case where the data request type is the data receiving type, the acquired network data is decrypted, the decrypted network data is stored based on the software identifier, and the decrypted network data is received.

4. The method for processing a network request according to claim 1, characterized in that: The storing the acquired network data based on the software identifier and processing the acquired network data includes: Based on the software identifier, the acquired network data is added to a pre-created target queue, so as to parse and process the network data in the target queue through an asynchronous thread for the target queue, and store the parsed network data; The acquired network data is processed through the main thread.

5. The method for processing a network request according to claim 4, characterized in that: The adding the acquired network data to a pre-created target queue based on the software identifier includes: Based on the data request type corresponding to the network request, determine the target queue from pre-created candidate queues, and add the acquired network data to the target queue based on the software identifier; Among them, different data request types correspond to different candidate queues.

6. The method for processing a network request according to claim 4, characterized in that: The adding the acquired network data to a pre-created target queue based on the software identifier includes: Based on the software identifier and the data request type corresponding to the network request, the acquired network data is subjected to identifier adding processing, and the network data subjected to identifier adding processing is added to the target queue.

7. The method for processing a network request according to claim 1, characterized in that: The storing the acquired network data based on the software identifier includes: Uploading the acquired network data to a preset storage address based on the software identifier; When a data query request is detected, target data is acquired from the preset storage address based on a request field carried in the data query request.

8. The method for processing a network request according to any one of claims 1 to 7, characterized in that: Before determining the reconfiguration request processing function corresponding to the network request in response to the network request initiated by the target application software, the method further includes: Obtain each original request processing function; different original request processing functions correspond to different request protocol types, or correspond to different data request types; For each of the original request processing functions, in response to a code implantation operation on the current original request processing function, modifying the current original request processing function into a reconfigured request processing function corresponding to the current original request processing function; Based on the reconfigured request processing functions corresponding to the original request processing functions, the source code of the operating system is modified, the modified source code is recompiled, and the recompiled executable file is installed.

9. A network request processing device, characterized in that: Configured in a terminal device, the device includes: A determination module, configured to determine, in response to a network request initiated by a target application software, a reconfiguration request processing function corresponding to the network request; wherein the reconfiguration request processing function is a request processing function obtained by pre-modifying an original request processing function of an operating system installed in the terminal device; A processing module is used to perform the following operations by calling a reconfiguration request processing function corresponding to the network request: obtaining the network data carried by the network request and the software identifier of the target application software; storing the obtained network data based on the software identifier, and performing data processing on the obtained network data.

10. A network request processing device, characterized in that: The network request processing device includes: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing network requests as described in any one of claims 1-8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for processing a network request as described in any one of claims 1 to 8 is implemented.