A network request analysis method and related device
By receiving the network request analysis instructions and optimization instructions from the client, and obtaining and analyzing the network request parameter information of the target module, the problems of low efficiency of network request performance analysis and low reference value in the prior art are solved, targeted and accurate performance analysis is achieved, and the reference value of analysis results is improved.
Patent Information
- Application Number
- CN202510349016.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-03-24
AI Technical Summary
When performing performance analysis of network requests in applications, the prior art is inefficient and has low reference value for the analysis results. It is mainly due to global capture that a large number of irrelevant requests require manual filtering, and the parameter information of all network requests is directly analyzed, resulting in one-sided results.
It provides a network request analysis method. By receiving network request analysis instructions sent by the client, it obtains the network request parameter information of the target module, and obtains the optimized network request parameter information based on the target module optimization instructions, and analyzes the two using preset performance analysis indicators to obtain performance analysis results.
By accurately intercepting the network requests of the target module, performance analysis can be carried out in a targeted manner, and performance comparison and analysis can be performed on the parameter information before and after optimization, and the specific role of each optimization measure on performance indicators can be learned in detail, the efficiency and accuracy of performance analysis can be improved, and the reference value of analysis results can be enhanced.
Smart Images

Figure CN119892656B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method for analyzing network requests and related devices. Background Art
[0002] With the rapid development of mobile Internet, applications are becoming more and more dependent on the network. Whether it is social applications delivering messages in real time, e-commerce applications displaying products and processing transactions, or video applications playing streaming media content, stable and efficient network connections are required to ensure smooth operation. Given the significant impact of the network environment on application performance and stability, it is crucial to perform performance analysis on network requests in applications.
[0003] Currently, a global network request capture method is often used, that is, all network requests generated by an application are captured, and performance analysis is directly performed on parameter information in all network requests.
[0004] However, a comprehensive application may contain multiple modules. Global capture will collect network requests from all modules, requiring manual filtering of a large number of irrelevant requests, which is inefficient and prone to missing important information. In addition, the analysis results obtained by directly analyzing the performance of parameter information in all network requests are relatively one-sided, which may result in a low reference value of the analysis results. Summary of the invention
[0005] In view of the above problems, the present application provides a network request analysis method and related devices to ensure the efficiency and accuracy of the network request analysis and improve the reference value of the analysis results. The specific scheme is as follows:
[0006] In a first aspect, the present application provides a method for analyzing a network request, the method for analyzing a network request is applied to a server, the server is connected to a client, and the method comprises:
[0007] Receiving a network request analysis instruction sent by the client, wherein the network request analysis instruction is used to instruct the server to analyze a network request of an application program, wherein the network request of the application program includes identification information of a target module in the application program;
[0008] Based on the identification information of the target module, obtaining parameter information of a first network request initiated by the target module;
[0009] receiving a target module optimization instruction sent by the client, wherein the target module optimization instruction is used to instruct the server to optimize the target module;
[0010] Based on the target module optimization instruction, obtaining parameter information of a second network request initiated by the optimized target module;
[0011] Based on at least one preset performance analysis indicator, the parameter information of the first network request and the parameter information of the second network request are analyzed to obtain a performance analysis result.
[0012] In a possible implementation, the analyzing the parameter information of the first network request and the parameter information of the second network request based on at least one preset performance analysis indicator to obtain a performance analysis result includes:
[0013] For each of the performance analysis indicators, based on the parameter information of the first network request and the parameter information of the second network request, calculating a change amount of the performance analysis indicator;
[0014] Inputting the change amount of the performance analysis index into a preset analysis result determination model to obtain the analysis result of the performance analysis index;
[0015] The analysis results of the performance analysis indicators are used as the performance analysis results.
[0016] In a possible implementation, the method further includes:
[0017] The parameter information of the first network request and the parameter information of the second network request are stored, wherein the parameter information at least includes a target address, a request method, a response time, and a status code.
[0018] In a possible implementation, the method further includes:
[0019] Inputting the performance analysis result into a pre-trained performance problem determination model to obtain the performance problem of the target module;
[0020] or,
[0021] The performance analysis result is visualized in an image format, and the performance problem of the target module is determined based on the visualized image.
[0022] In a possible implementation, the method further includes:
[0023] Use the OHHTTPStubs component to configure the parameter information of the first network request and the parameter information of the second network request respectively, to obtain the parameter information of the first network request under multiple network conditions and the parameter information of the second network request under multiple network conditions;
[0024] For each of the network conditions, based on each of the performance analysis indicators, the parameter information of the first network request under the network condition and the parameter information of the second network request under the network condition are analyzed to obtain a performance analysis result under the network condition.
[0025] A second aspect of the present application provides a network request analysis device, the network request analysis device is applied to a server, the server is connected to a client, and the device includes:
[0026] A first receiving unit, configured to receive a network request analysis instruction sent by the client, wherein the network request analysis instruction is used to instruct the server to analyze a network request of an application program, wherein the network request of the application program includes identification information of a target module in the application program;
[0027] A first acquisition unit, configured to acquire parameter information of a first network request initiated by the target module based on the identification information of the target module;
[0028] A second receiving unit, used for a target module optimization instruction sent by the client, wherein the target module optimization instruction is used to instruct the server to optimize the target module;
[0029] A second acquisition unit, configured to acquire parameter information of a second network request initiated by the optimized target module based on the target module optimization instruction;
[0030] An analysis unit is used to analyze the parameter information of the first network request and the parameter information of the second network request based on at least one preset performance analysis indicator to obtain a performance analysis result.
[0031] In a possible implementation, the analysis unit includes:
[0032] a calculation subunit, configured to calculate, for each of the performance analysis indicators, a change amount of the performance analysis indicator based on the parameter information of the first network request and the parameter information of the second network request;
[0033] An input subunit, used for inputting the variation of the performance analysis index into a preset analysis result determination model to obtain the analysis result of the performance analysis index;
[0034] A determination subunit is used to use the analysis results of each of the performance analysis indicators as the performance analysis result.
[0035] A third aspect of the present application provides a computer program product, comprising computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the method for analyzing network requests of the first aspect or any implementation of the first aspect.
[0036] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0037] The memory is used to store computer programs;
[0038] The processor is used to execute the computer program so that the electronic device can implement the method for analyzing network requests of the first aspect or any implementation of the first aspect.
[0039] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can perform the method for analyzing network requests according to the first aspect or any implementation of the first aspect.
[0040] By means of the above technical scheme, the present application provides a method for analyzing a network request and a related device, the method for analyzing a network request is applied to a server, the server is connected to a client, and the method includes: receiving a network request analysis instruction sent by a client, the network request analysis instruction is used to instruct the server to analyze the network request of an application, the network request of the application includes the identification information of a target module in the application; based on the identification information of the target module, obtaining the parameter information of a first network request initiated by the target module; receiving a target module optimization instruction sent by a client, the target module optimization instruction is used to instruct the server to optimize the target module; based on the target module optimization instruction, obtaining the parameter information of a second network request initiated by the optimized target module; based on at least one preset performance analysis indicator, analyzing the parameter information of the first network request and the parameter information of the second network request to obtain a performance analysis result. By accurately intercepting the network request of the target module, the present scheme can perform performance analysis on the network request in a targeted manner, and perform performance comparison analysis on the obtained parameter information before and after optimization, so as to understand in detail the specific effect of each optimization measure on each performance indicator, which is conducive to more accurate and efficient performance analysis and improves the reference value of the performance analysis result. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0042] Figure 1 A flowchart of a method for analyzing a network request provided in an embodiment of the present application;
[0043] Figure 2 A schematic diagram of the structure of a network request analysis device provided in an embodiment of the present application;
[0044] Figure 3 A schematic diagram of the hardware structure of a network request analysis device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0046] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0047] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0048] In order to ensure the efficiency and accuracy of the analysis of network requests and improve the reference value of the analysis results, the present application provides a method for analyzing network requests. The following is a further detailed description of the method for analyzing network requests provided by the present application in conjunction with the accompanying drawings and specific implementation methods.
[0049] Please see attached Figure 1 , Figure 1 A flowchart of a method for analyzing a network request provided in an embodiment of the present application. The method for analyzing a network request is applied to a server, which is connected to a client. The method may include the following steps:
[0050] Step S101: receiving a network request analysis instruction sent by a client, where the network request analysis instruction is used to instruct the server to analyze a network request of an application program, where the network request of the application program includes identification information of a target module in the application program.
[0051] It should be noted that the client will send network request analysis instructions to the server. The client can be a test tool used by developers or a part of the application. In a specific test or performance analysis scenario, it triggers the server to analyze the network requests of the application. In a complex application, it usually contains multiple functional modules, each of which will initiate a network request. For example, in an e-commerce application, it may contain a user login module, a product search module, a shopping cart module, an order processing module, etc.
[0052] In this application, after receiving the network request analysis instruction, the server will start the analysis process of the network request of the application to obtain the identification information of the target module in the application. The identification information of the target module can accurately locate the specific module that needs to be analyzed. By specifying the target module, the server can narrow the scope of the analysis, avoid indiscriminate analysis of all network requests of the entire application, and improve the pertinence and efficiency of the analysis. For example, if you want to analyze the network request performance of the product search module, the developer can include the identification information of the product search module in the request when sending the network request analysis instruction. After receiving it, the server can analyze the network request initiated specifically for this module.
[0053] Among them, the identification information of the product search module can be in various forms: Module number: assign a unique digital number to the product search module, such as "003". Universal unique identifier UUID: composed of numbers and letters, such as "550e8400-e29b-41d4-a716-446655440000". The UUID generation algorithm ensures that it is almost impossible to have duplications worldwide. It is particularly suitable for large-scale distributed applications or multi-system integration scenarios, and can effectively avoid the problem of module identification conflicts in different environments. Module name: use the English name of the product search module as an identifier, such as "ProductSearchModule". You can also use the Chinese name as an identifier, such as "Product Search Module". Function tag: add a specific function tag to the product search module, such as "search-product". This tag can concisely reflect the core function of the module. When the server receives a network request analysis instruction containing this tag, it can be determined that the instruction is for the product search module. The advantage of the function tag is that it can not only identify the module, but also convey the main functional information of the module. Business keywords: Combine the business scenarios involved in the product search module and use relevant keywords as identifiers. For example, in e-commerce applications, if the product search module is mainly used to search for promotional products, "promotion-product-search" can be used as identification information.
[0054] The data of each module in the application is stored independently to ensure the accuracy and manageability of the data. Each module has its own unique functions and data interaction mode in the application. Storing its performance data independently can avoid interference between data from different modules, making the performance analysis of each module more accurate and in-depth. For example, in an e-commerce application, the business logic and performance characteristics of the product display module and the order processing module are quite different. If their data are stored together, when analyzing the performance of the product display module, it may be interfered by the data of the order processing module, resulting in inaccurate analysis results.
[0055] Step S102: based on the identification information of the target module, obtaining parameter information of the first network request initiated by the target module.
[0056] In the present application, the lightweight network request interceptor can capture all network requests in the application and perform modular classification. The lightweight network request interceptor can traverse the identification information carried by each module based on the identification information of the target module, thereby determining the target module, and then obtaining the parameter information of the first network request initiated by the target module. At the same time, the parameter information of the first network request can also be stored, and the parameter information at least includes the target address, request method, response time and status code.
[0057] Specifically, method exchange can be performed through the runtime mechanism, and custom logic can be inserted to obtain parameter information of HTTP / HTTPS requests without modifying the original behavior of the system or framework. When intercepting relevant methods of the Session class of the NS target address, class_getClassMethod and class_getInstanceMethod are used to obtain class methods and instance methods, and then method_exchangeImplementations is used to exchange method implementations. In the replaced method, code logic can be added to record and obtain the various network request parameter information mentioned above. For example, in the replaced sending request method, parameter information such as the request path and request method of the network request is recorded before the request is sent, and information such as the response time is recorded when the response is received. In this way, by cleverly utilizing the runtime mechanism, the acquisition of network request parameter information is realized, and the normal operation of the original network request function of the application is guaranteed. The parameter information of the first network request includes but is not limited to:
[0058] Target address: The target address specifies the target resource location of the request. For network requests of the product search module, the target address may contain information such as search keywords, filter conditions, and sorting rules. For example, "https: / / example.com / api / products?search=phone&category=electronics&sort=price-desc", through this target address, we can know that the user is searching for mobile phones under the category of electronic products, and wants to sort them from high to low by price. After the server obtains this target address information, it can analyze the specific direction of the request of the product search module and the user's search intention, which is of great significance for evaluating the performance of the search function and optimizing the search algorithm.
[0059] Request method: Common request methods include GET, POST, PUT, DELETE, etc. Different request methods are used to perform different types of operations. For example, for the product search module, a GET request is usually used to obtain a list of qualified products. When the user enters the search keyword in the application and clicks the search button, the product search module sends a GET request to the server, carrying parameters such as the search keyword. The server obtains the request method information to understand the way data is interacted between the product search module and the server, and to determine whether there are performance problems caused by improper use of request methods. For example, if a POST request is mistakenly used in a scenario where a GET request should be used, it may increase unnecessary data transmission and processing overhead.
[0060] Response time: reflects the time it takes from the client initiating a request to receiving a server response. When intercepting the relevant methods of the NS target address Session class through method exchange, you can record a timestamp at the starting point of the request (for example, use a high-precision clock to obtain the current time). When the response is received, record another timestamp. The difference between the two timestamps is the response time. For the product search module, a shorter response time means that users can get search results faster. If the response time is too long, the server can further analyze whether it is caused by network transmission delays, long server processing time, or other reasons, so as to optimize it in a targeted manner.
[0061] Status code: It is the server's feedback on the request processing result. Common status codes include 200 for successful request, 404 for resource not found, and 500 for internal server error. Storing status codes allows developers to quickly understand the execution results of requests and determine whether there are any abnormalities. For example, if the 404 status code appears frequently, it may mean that the resource path that the product search module relies on has changed, or the data is missing and needs to be repaired in time.
[0062] Recording and storage of request data. The interceptor needs to record the request parameters in detail, such as the target address, method, response time, status code, etc., and store them for subsequent analysis. The technical difficulty lies in how to efficiently store and manage a large amount of request data to ensure that the performance of data recording does not affect the running speed of the application. Receive the source data from the interception module and store the detailed information of each request in a local or remote database through Realm. In order to improve data processing efficiency, this module is also responsible for compressing and optimizing the data to ensure efficient storage and accuracy of subsequent analysis.
[0063] When performing performance analysis on the network requests of the target module, storing this information can provide a rich data foundation for subsequent in-depth and comprehensive performance analysis. For example, by storing and comparing parameter information such as the target address and response time of multiple network requests of the product search module over a period of time, developers can discover performance change trends, such as whether the response time gradually increases with the increase in data volume, thereby identifying potential performance bottlenecks.
[0064] During the operation of the application, various problems may occur, such as network request failure, abnormal response data, etc. Storing the parameter information of the first network request can help developers to perform retrospective analysis when problems occur. For example, if a user reports that the product search results are inaccurate, the developer can find the stored parameter information of the search request, including search keywords, request methods, and filter conditions in the request body, to determine whether the problem lies in the user input, request process, or server processing.
[0065] The stored parameter information can support the analysis of network requests from multiple dimensions. In addition to the performance dimension, it can also be analyzed from the perspectives of user behavior, business logic, etc. For example, by analyzing the request parameters of different users in the product search module, we can understand the user's search habits and preferences, and provide data support for optimizing the search algorithm and product recommendation system.
[0066] There are multiple ways to store the parameter information of the first network request, and each way will be described in detail below:
[0067] Database storage includes relational databases and non-relational databases. Relational databases: such as MySQL, Oracle, etc., can store network request parameter information in a structured manner according to different fields. For example, create a table called "network_requests" containing fields such as "request_id" (uniquely identifies each request), "target address", "request_method", "response_time", "request_header", and "request_body". This method facilitates complex queries and statistical analysis, and is suitable for scenarios with high requirements for data consistency and transaction processing. For example, the average response time of different request methods of the commodity search module within a specific time period can be counted through SQL query statements. Non-relational databases: such as MongoDB, are suitable for storing semi-structured or unstructured data. For network request parameter information, especially the request header and request body may contain complex JSON format data, MongoDB can directly store data in this format without pre-defining a strict table structure. This makes storage and query more flexible, and is suitable for development scenarios where data structures change frequently or require rapid iteration. For example, during the development process, if the request body structure of the product search module changes, using MongoDB can quickly adapt to this change without making large-scale modifications to the database structure.
[0068] File storage includes log file storage and binary file storage. Log file: records the parameter information of network requests in the form of text files, with each line recording relevant information of a request. For example, "[2024-10-01 12:34:56]GET https: / / example.com / api / products / search?keyword=phone&category=electronics 200 500ms {"User - Agent": "MyApp / 1.0 (iOS 15.0)"} { "keyword":"phone", "category": "electronics"}". The advantage of log files is that they are simple and easy to implement, suitable for quick recording and preliminary analysis. Developers can use text processing tools to search and analyze log files to find specific types of requests or requests with abnormal performance. Binary file: For some data that needs to be stored and read efficiently, or for scenarios with specific requirements for data format, binary file storage can be used. For example, the request parameter information is serialized and stored as a binary file, and deserialized and read when needed. This method is usually used when high storage efficiency and data integrity are required, but it is relatively complex and requires specialized reading and writing programs.
[0069] As time goes by, the stored network request parameter information will continue to increase, occupying a large amount of storage space. Therefore, it is necessary to regularly clean up data and delete expired or no longer needed data. For example, for old request data that has been completed for performance analysis and is no longer of reference value, it can be deleted according to a certain time period (such as one month). At the same time, when deleting data, make sure that it will not affect the ongoing analysis work or troubleshooting.
[0070] In order to prevent data loss, it is necessary to regularly back up the stored network request parameter information. You can use a combination of full backup and incremental backup to reduce backup costs and time. For example, perform a full backup once a week and an incremental backup every day. The backed up data can be stored in different storage media or geographical locations to cope with possible hardware failures, natural disasters, and other situations.
[0071] Network request parameter information may contain sensitive information, such as user login credentials, personal information, etc. (under some improper request design). Therefore, strict data security measures should be taken, such as encrypting stored data and limiting access to stored data. Only authorized developers or operation and maintenance personnel can access and operate this data.
[0072] Step S103: receiving a target module optimization instruction sent by the client, where the target module optimization instruction is used to instruct the server to optimize the target module.
[0073] Throughout the life cycle of an application, the client will continue to interact with the server to implement various functions. As the business evolves, user needs change, and the pursuit of performance increases, some modules in the application may need to be optimized. For example, in an e-commerce application, as the number of products continues to increase, the search response time of the product search module becomes longer, affecting the user experience. Based on the monitoring of application performance, user feedback, or changes in business needs, the client operator determines that a specific module needs to be optimized, and decides to send the target module optimization instruction to the server.
[0074] The client usually generates the instruction with the help of a specific tool or interface. In the development phase, developers generate instructions through a series of operations in an integrated development environment (IDE) or a dedicated performance analysis tool. They first locate the target module that needs to be optimized, which may be achieved through a module list, a search function, or by directly selecting it in the code structure. For example, for the product search module, the developer selects the module in the tool interface. Then, the developer may set some optimization-related parameters, such as the expected performance indicators, such as reducing the average response time of product search from the current 5 seconds to 2 seconds, or setting the optimization direction, such as prioritizing the optimization of database query statements to improve search efficiency. After completing these settings, the target module optimization instruction is sent to the server by clicking buttons such as "Send Optimization Instructions". In the testing phase, if the tester finds that a module has performance problems based on the performance test report, he will also generate and send similar instructions through the test management tool.
[0075] The target module optimization instruction may include the identification information of the target module. Through this identification, the server can accurately locate the specific optimization object from many modules. For example, the identification information may be the unique number, specific name or other unique identifier of the module. Taking the product search module as an example, its identification may be "ProductSearchModule". After receiving the instruction, the server can determine that the product search module needs to be optimized based on this identification.
[0076] The target module optimization instructions can also carry specific requirements or suggestions related to the optimization. These requirements can be the performance indicators that are expected to be achieved, such as reducing the error rate to below 1%, or increasing the throughput to 100 requests per second. It can also be guidance on the optimization direction, such as suggestions to start from algorithm optimization, cache strategy adjustment, network transmission optimization, etc. For example, for the image loading module, the instructions may suggest improving performance by optimizing the image compression algorithm and adjusting the cache strategy. These requirements provide the server with clear optimization goals and directions, helping the server to formulate specific optimization strategies.
[0077] Step S104: based on the target module optimization instruction, obtaining parameter information of the second network request initiated by the optimized target module.
[0078] In this application, when the target module is optimized, if the user or system continues to use the module, a second network request will be initiated. For example, for the optimized product search module, when the user enters the search keyword again to search, a new network request will be initiated, which is the second network request. The server needs to monitor and collect information on these optimized network requests.
[0079] Target address: This is the final location that the network request points to. For optimized network requests, the target address may vary depending on the specific circumstances of the optimization. For example, in some optimization processes, requests that originally pointed to the old search service interface may be redirected to the new search service interface to obtain better performance or functionality, and the target address will change. It reflects the new location or resource adjustment of the service provided by the optimized server.
[0080] Request method: Common request methods include GET, POST, PUT, DELETE, etc. The request method may be adjusted for different optimization measures. For example, before optimization, the POST method may be used to submit a search request, and after optimization, the GET method may be used to simplify the complexity of the request and improve the efficiency of the request. The server will record the request method used by the optimized network request to analyze the impact of different request methods on performance.
[0081] Response time: It is the time from sending a request to receiving a complete response, and is a key indicator for measuring the effect of optimization. The server will accurately record the response time of the second network request after optimization. By comparing it with the response time before optimization, you can intuitively see whether the optimization has achieved results. For example, if the response time of the search module before optimization is 2 seconds, and it is reduced to 1 second after optimization, it means that the optimization has achieved positive results in improving the response speed.
[0082] Status code: It is a representation of the result of the server processing the request. For example, the common 200 indicates a successful request, 404 indicates that the resource is not found, and 500 indicates an internal server error. For optimized network requests, the status code can help determine whether the optimization has caused new problems. If more 500 status codes appear after optimization, it may mean that errors were introduced during the optimization process, and further inspection of the code or service deployment is required.
[0083] Parameter information of the second network request may also be stored, where the parameter information at least includes a target address, a request method, a response time, and a status code.
[0084] In this application, by storing the parameter information of the optimized second network request, developers and operation and maintenance personnel can clearly understand whether the optimization has achieved the expected goal and find out possible problems. For example, if multiple sets of parameter information at different optimization stages are stored, a time series of performance analysis can be formed to help observe performance change trends.
[0085] Database storage can store parameter information in the database, which is convenient for structured storage and subsequent complex queries. For example, the server can store the parameter information of each second network request in a special table. The columns in the table may include information such as the unique identifier of the request, the target address, the request method, the response time, the status code, and the record timestamp. By storing it in the database, it is convenient to filter and analyze the data according to different conditions, such as filtering out the request information of a specific time period, a specific module, or a specific request method, in order to evaluate the optimization effect and find problems.
[0086] File storage in the form of log files is also a common method. The parameter information of the second network request is recorded line by line in the log file. Each line can contain information such as the time when the request occurred, the target address, the request method, the response time, and the status code. This method is simple and intuitive, and is convenient for quick text screening and analysis. For example, when you need to view the request status within a certain time period, you can use the text search tool to view the log records within the time period to determine whether any abnormalities have occurred.
[0087] The stored information will accumulate over time, so reasonable storage management is required. Outdated information needs to be cleaned up regularly to avoid taking up too much storage space. At the same time, to ensure that the stored data is secure and prevent sensitive information from being leaked, parameters containing sensitive information may need to be encrypted.
[0088] Step S105: Based on at least one preset performance analysis indicator, the parameter information of the first network request and the parameter information of the second network request are analyzed to obtain a performance analysis result.
[0089] Data display and comparative analysis: Develop an intuitive visual interface to display request records and performance analysis results, including information such as request times and response times. Provide search and comparison functions to display the performance of a specific interface in different network environments. The challenge here is how to maintain interface response speed and clarity of data display while processing large amounts of data.
[0090] Through comparative analysis, such as the difference in data before and after optimization of the live broadcast or message module in different network environments, users can intuitively see the optimization effect. Developers can quickly locate performance bottlenecks and perform targeted optimizations, thereby improving the overall network performance and user experience of the application.
[0091] The comparison and analysis function of module performance has also been specially strengthened. To achieve this goal, developers need to ensure that the data of each module can be stored independently, and support cross-comparison of data between modules. The comparison function of module performance data can help developers evaluate the performance of modules before and after interface optimization or in different network environments (such as the reduction in the number of interfaces, the shortening of response time or the reduction of bandwidth consumption, etc.), and comprehensively measure the improvement effect brought by optimization; for example, in the optimization scenario of the live broadcast module, entering the live broadcast room may require calling 10 interfaces to complete the loading, but after optimization, only 5 interfaces need to be called to achieve the same loading effect, while significantly reducing network consumption and loading time. The performance analysis engine can record and compare the request data of each interface before and after optimization, including key indicators such as response time, status code, bandwidth consumption, etc., and generate intuitive analysis reports to quantify the performance improvement brought by optimization. This data comparison function enables developers to clearly understand the specific results of optimization, quickly locate bottleneck problems and formulate the next optimization plan.
[0092] In the present application, firstly, for each performance analysis indicator, based on the parameter information of the first network request and the parameter information of the second network request, the change amount of the performance analysis indicator is calculated. Then, the change amount of the performance analysis indicator is input into a pre-set analysis result determination model to obtain the analysis result of the performance analysis indicator. Finally, the analysis result of each performance analysis indicator is used as the performance analysis result.
[0093] Specifically, in the performance analysis of network requests, multiple important performance analysis indicators are involved, such as the number of requests, response time, bandwidth consumption, status code, etc. For the first network request and the second network request, their respective parameter information has been collected, and this information contains the data of the above key indicators.
[0094] For example, the response time of the first network request may be 500 milliseconds, and the response time of the second network request may be 300 milliseconds; the bandwidth consumption of the first network request may be 1MB, and the bandwidth consumption of the second network request may be 500KB. The change in response time is obtained by subtracting the response time of the first network request from the response time of the second network request. As in the above example, the change in response time is 300 milliseconds - 500 milliseconds = -200 milliseconds, which means that the response time is shortened by 200 milliseconds, which is a manifestation of performance improvement. Similarly, for bandwidth consumption, the bandwidth consumption of the second network request is subtracted from the bandwidth consumption of the first network request to obtain the change in bandwidth consumption. For example, 500KB-1MB = -500KB (note the unit conversion here), which means that the bandwidth consumption is reduced by 500KB, which means that the optimization reduces the amount of data transmission and the optimization effect is good.
[0095] Changes in other indicators: Similar calculation methods are used for other performance analysis indicators such as the number of requests and status codes. For the number of requests, if the number of requests for the first network request is 100 and the number of requests for the second network request is 80, then the change in the number of requests is 80-100=-20 times, which may indicate that the efficiency of the system in processing requests has improved and that so many requests are no longer needed. For status codes, it is necessary to pay attention to changes in error status codes (such as 4xx and 5xx). If the frequency of error status codes before optimization is 10% and after optimization is 2%, then the change in error status codes is 2%-10%=-8%, indicating that the error rate has decreased and system stability has improved.
[0096] The model is a set of pre-set rules or algorithms that are used to determine the final performance analysis results based on the changes in performance analysis indicators. Its purpose is to convert the quantified changes into more instructive performance analysis results so that developers can intuitively understand the effect of optimization. For example, for the change in response time, if the shortened time reaches a certain threshold (such as more than 30%), it can be judged as a significant optimization in the model; for bandwidth consumption, if the reduction reaches a certain proportion (such as 50%), it can also be considered a good optimization result.
[0097] After calculating the changes in each performance analysis indicator, these changes are passed as inputs to the analysis result determination model. The model will evaluate these inputs based on internal judgment rules. For the change of -200 milliseconds in response time, the model will calculate the ratio of -200 milliseconds to 500 milliseconds as 40% based on the preset rules, such as taking the original response time as the benchmark. If the model sets a response time reduction of more than 30% as a significant optimization, then this response time change will be judged as a significant optimization. For the change of -500KB in bandwidth consumption, the model will judge whether this optimization meets expectations based on the total reduction ratio of bandwidth consumption and the set evaluation criteria. If a 40% reduction in bandwidth consumption is set as an ideal optimization, then it is necessary to further calculate its reduction ratio (assuming that 1MB is 1024KB, the reduction ratio is about 49%), and it will be judged that this optimization meets or exceeds expectations.
[0098] Finally, the analysis results of each performance analysis indicator are summarized together to form a comprehensive performance analysis result. This will cover the evaluation of response time, bandwidth consumption, number of requests, status code and other aspects. Taking the live broadcast module as an example, the performance analysis result may be: "Response time is shortened by 40%, which is significantly optimized; bandwidth consumption is reduced by 49%, meeting optimization expectations; number of requests is reduced by 20%, which is partially optimized; error rate is significantly reduced, system stability is improved, and it is significantly optimized." This comprehensive performance analysis result can provide developers with a clear overview of the performance optimization effect, allowing them to fully understand the impact of optimization on various aspects.
[0099] Developers can use this performance analysis result to determine whether the optimization measures are effective and which aspects need further improvement. If the performance on a certain indicator is poor, such as the optimization of the number of requests is only partially optimized, developers can study the indicator in depth to find out the possible reasons, such as whether there are redundant requests that have not been optimized.
[0100] The result can also be used as a basis for decision-making, whether to continue the current optimization strategy or adjust the optimization direction. For example, if the response time has improved but has not reached the ideal optimization level, it may be necessary to further optimize the algorithm or server processing logic; if the error rate is still high, it is necessary to check the error handling logic in the code or the stability of the network connection.
[0101] Furthermore, the OHHTTPStubs component can be used to configure the parameter information of the first network request and the parameter information of the second network request respectively, and obtain the parameter information of the first network request under multiple network conditions and the parameter information of the second network request under multiple network conditions. For each network condition, based on each performance analysis indicator, the parameter information of the first network request under the network condition and the parameter information of the second network request under the network condition are analyzed to obtain the performance analysis results under the network condition.
[0102] It should be noted that OHHTTPStubs can help developers simulate various network conditions. In actual development and testing, applications will run in different network environments, such as 2G, 3G, 4G, WiFi, etc., and these network environments will have different effects on the performance of network requests. OHHTTPStubs allows developers to simulate these different network conditions during the development and testing phases without relying on actual network environment changes. For example, it can simulate network speed, network delay, network interruption or instability, etc., in order to test the performance of applications under different network conditions.
[0103] For the parameter information of the first network request and the second network request, OHHTTPStubs can simulate different network conditions for them respectively. Through OHHTTPStubs, the parameter information of the first network request can be configured to simulate the situation under multiple network conditions. For example, when simulating 2G network conditions, the network speed can be set to a lower value, such as tens of kbps, and a certain delay time can be added, such as a 5-second delay; for 3G network conditions, the network speed can be set to hundreds of kbps, and the delay time can be set to 2 seconds. In this way, various parameter information of the first network request under different network conditions can be obtained. These parameter information will change with different network conditions, including the sending time of the request, the response time, the data transmission volume, the success rate of the request, etc. Similarly, the parameter information of the second network request can also be configured similarly using OHHTTPStubs. In the optimized case, the performance of the second network request under different network conditions can be seen. For example, in a simulated 4G network environment, the response time of the second network request may be shorter than that of the first network request due to optimization, or in the case of unstable network, the error rate of the second network request may be lower than that of the first network request.
[0104] For each simulated network condition, it is necessary to analyze it according to the pre-set performance analysis indicators. These performance analysis indicators include but are not limited to response time, throughput, error rate, bandwidth consumption, data transmission volume, etc.
[0105] Under different network conditions, measure the response time of the first network request and the second network request respectively. Under 2G network conditions, the first network request may have a long response time due to slow network speed and high latency, while the response time of the second network request may be improved after optimization, but it may still be limited by the 2G network. By comparing the response times of the two, we can see the effect of the optimization measures under different network conditions. For example, the response time of the first network request under 2G network is 10 seconds, and the second network request may be 7 seconds, which shows that under 2G network conditions, the optimization shortens the response time by 3 seconds.
[0106] Measure the number of requests that can be processed or the amount of data transmitted by the first network request and the second network request under different network conditions within a certain period of time. Under WiFi network conditions, it may be found that the throughput of the first network request is low, while the throughput of the second network request may be improved after optimization, indicating that the optimization measures have improved the system's processing capacity and data transmission efficiency under a good network environment.
[0107] Statistics are collected to show the ratio of the number of requests with errors in the first network request and the second network request to the total number of requests under different network conditions. Under simulated conditions of unstable network, the first network request may have a higher error rate, while the second network request may have a lower error rate due to the optimized error handling mechanism. For example, under simulated network interruption, the error rate of the first network request may be 30%, while the error rate of the second network request may be reduced to 10%, indicating that the optimization has improved the stability of the system under harsh network conditions.
[0108] Observe the bandwidth consumption of the first network request and the second network request under different network conditions. For the first network request, the bandwidth consumption may be large due to the unoptimized data transmission method under the 3G network; while the second network request may reduce bandwidth consumption and improve the utilization efficiency of network resources by compressing data or optimizing data transmission protocols under the same network conditions.
[0109] Compare the request and response data sizes of the first network request and the second network request under different network conditions. Optimization may make the data transmission volume of the second network request more reasonable under different network conditions, reduce unnecessary data transmission, and improve performance. For example, under a 4G network, the data transmission volume of the first network request is 2MB, while the data transmission volume of the second network request may be 1.5MB, indicating that the optimization has achieved certain results in data transmission.
[0110] For each network condition, a corresponding performance analysis result will be obtained. These results will show the performance and optimization effect of the first network request and the second network request on various performance indicators under the network condition. Such performance analysis results can help developers fully understand the optimization effect under different network conditions and provide them with detailed data support for further optimization decisions.
[0111] In summary, the present application provides a method for analyzing a network request, which is applied to a server, and the server is connected to a client. The method includes: receiving a network request analysis instruction sent by a client, the network request analysis instruction is used to instruct the server to analyze the network request of an application, and the network request of the application includes the identification information of a target module in the application; based on the identification information of the target module, obtaining the parameter information of the first network request initiated by the target module; receiving a target module optimization instruction sent by a client, the target module optimization instruction is used to instruct the server to optimize the target module; based on the target module optimization instruction, obtaining the parameter information of the second network request initiated by the optimized target module; based on at least one preset performance analysis indicator, analyzing the parameter information of the first network request and the parameter information of the second network request to obtain a performance analysis result. This scheme can perform performance analysis on the network request in a targeted manner by accurately intercepting the network request of the target module, and perform performance comparison analysis on the obtained parameter information before and after optimization, so as to understand in detail the specific effect of each optimization measure on each performance indicator, which is conducive to more accurate and efficient performance analysis and improves the reference value of the performance analysis results.
[0112] The parameter information of the first network request and the parameter information of the second network request are stored, and the parameter information at least includes a target address, a request method, a response time, and a status code.
[0113] Based on the above embodiment, the method may further include:
[0114] As an implementable method, the performance analysis results may be input into a pre-trained performance problem determination model to obtain the performance problem of the target module.
[0115] The performance problem determination model is a model based on machine learning or other algorithms, which has been trained with a large amount of data before use. These training data usually contain various performance analysis results and corresponding known performance problems, so that the model can learn the correlation patterns between various indicators in the performance analysis results and performance problems.
[0116] Specifically, the training process of the performance problem determination model includes: obtaining multiple training samples with labeled information, the labeled information includes performance problems, and each training sample includes a performance analysis result; training the initial positioning model based on the multiple training samples to obtain the performance problem determination model, the input of the performance problem determination model is the performance analysis result, and the output of the performance problem determination model is the performance problem.
[0117] As another possible implementation method, the performance analysis result may be visualized in the form of an image, and the performance problem of the target module may be determined based on the visualized image.
[0118] In this application, visualization means presenting the performance analysis results in the form of graphs or images, so as to intuitively observe the changing trends and relationships of performance indicators. Common visualization methods include bar graphs, line graphs, pie charts, scatter plots, etc. For example, for response time, a line graph can be used to show the change in response time before and after optimization at different time points or under different network conditions. The horizontal axis can be time or network conditions, and the vertical axis is response time; for error rate, a pie chart can be used to show the proportion of different types of errors; for throughput and bandwidth consumption, a bar graph can be used to compare the changes in indicators before and after optimization.
[0119] By observing the trend of the graph, you can find some clues to performance problems. For example, in the response time line graph, if the optimized response time still shows an upward trend, it may mean that the optimization measures have not effectively suppressed the growth trend of the response time. It may be that over time, the system load has increased without corresponding resource expansion or optimization strategies, or some undiscovered code performance problems have caused the response time to gradually increase.
[0120] When comparing the throughput before and after optimization in a bar chart, if you find that the throughput after optimization does not increase significantly or even decreases, it may imply that the system's concurrent processing capability has not been improved. It may be that the server thread pool is set up unreasonably, the network connection pool is poorly managed, or the newly introduced code has a negative impact on concurrent processing.
[0121] Visualization facilitates comparison between different metrics. For example, by putting a line graph of response time and error rate on the same graph, you may find that when the response time suddenly increases, the error rate also increases accordingly, which may indicate that the long response time may cause timeout errors or other abnormal conditions, thus affecting the stability of the system.
[0122] At the same time, when displaying performance indicators under different network conditions, such as the bandwidth consumption bar chart under different network conditions, you can intuitively see the changes in bandwidth consumption in different network environments. If the bandwidth consumption is abnormally high under low network speed, it may mean that the application has not adaptively adjusted the data transmission strategy according to the network conditions, resulting in low data transmission efficiency.
[0123] From the visualization, you may find some signs of performance bottlenecks. For example, in the graph showing the relationship between the number of requests and the response time, if the response time rises sharply in the area of high request times, it may indicate that the system's processing capacity has reached a bottleneck under high load conditions, and you may need to expand the system architecture or optimize the algorithm to improve performance. When showing the performance indicator comparison chart of different modules, if the performance indicator of a module is significantly lower than that of other modules, you can quickly find that the module may have performance problems, and further analysis is needed on its internal code logic, resource allocation, or network request processing.
[0124] In summary, both methods provide developers with different ways to discover performance issues of target modules. The former uses the intelligent prediction capabilities of machine learning models, while the latter uses the intuitiveness of visualization to help developers examine performance analysis results from different angles, thereby optimizing the performance of target modules in a more targeted manner and improving the overall performance and user experience of the application.
[0125] A method for analyzing a network request provided in an embodiment of the present application is introduced above, and a device for analyzing the network request will be introduced below.
[0126] See also Figure 2 , Figure 2 The present invention provides a schematic diagram of a network request analysis device according to an embodiment of the present invention. The network request analysis device is applied to a server, and the server is connected to a client. Figure 2 As shown, the network request analysis device includes:
[0127] The first receiving unit 11 is used to receive a network request analysis instruction sent by the client, wherein the network request analysis instruction is used to instruct the server to analyze the network request of the application program, wherein the network request of the application program includes identification information of a target module in the application program.
[0128] The first acquisition unit 12 is used to acquire parameter information of a first network request initiated by the target module based on the identification information of the target module.
[0129] The second receiving unit 13 is used for receiving the target module optimization instruction sent by the client, wherein the target module optimization instruction is used to instruct the server to optimize the target module.
[0130] The second acquisition unit 14 is used to acquire parameter information of a second network request initiated by the optimized target module based on the target module optimization instruction.
[0131] The analyzing unit 15 is used to analyze the parameter information of the first network request and the parameter information of the second network request based on at least one preset performance analysis indicator to obtain a performance analysis result.
[0132] In a possible implementation, the analysis unit 15 includes:
[0133] A calculation subunit is used to calculate, for each of the performance analysis indicators, a change in the performance analysis indicator based on the parameter information of the first network request and the parameter information of the second network request.
[0134] The input subunit is used to input the variation of the performance analysis index into a preset analysis result determination model to obtain the analysis result of the performance analysis index.
[0135] A determination subunit is used to use the analysis results of each of the performance analysis indicators as the performance analysis result.
[0136] In a possible implementation, the device further includes:
[0137] A storage unit is used to store parameter information of the first network request and parameter information of the second network request, wherein the parameter information at least includes a target address, a request method, a response time, and a status code.
[0138] In a possible implementation, the device further includes:
[0139] The input unit is used to input the performance analysis result into a pre-trained performance problem determination model to obtain the performance problem of the target module.
[0140] or,
[0141] The determination unit is used to visualize the performance analysis result in an image and determine the performance problem of the target module based on the visualized image.
[0142] In a possible implementation, the device further includes:
[0143] A configuration unit is used to use the OHHTTPStubs component to configure the parameter information of the first network request and the parameter information of the second network request respectively, to obtain the parameter information of the first network request under multiple network conditions and the parameter information of the second network request under multiple network conditions.
[0144] A result analysis unit is used to analyze, for each of the network conditions, the parameter information of the first network request under the network condition and the parameter information of the second network request under the network condition based on each of the performance analysis indicators, to obtain a performance analysis result under the network condition.
[0145] The present application also provides an electronic device in an embodiment. Figure 3 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 3 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0146] like Figure 3 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 to a random access memory (RAM) 303. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 303. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0147] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a memory card, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0148] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any network request analysis method provided in the embodiment of the present application.
[0149] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any network request analysis method provided in an embodiment of the present application.
[0150] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0151] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0152] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0153] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A method for analyzing a network request, characterized in that: The network request analysis method is applied to a server, which is connected to a client. The method includes: Receiving a network request analysis instruction sent by the client, wherein the network request analysis instruction is used to instruct the server to analyze a network request of an application program, wherein the network request of the application program includes identification information of a target module in the application program; Based on the identification information of the target module, obtaining parameter information of a first network request initiated by the target module; receiving a target module optimization instruction sent by the client, wherein the target module optimization instruction is used to instruct the server to optimize the target module; Based on the target module optimization instruction, obtaining parameter information of a second network request initiated by the optimized target module; Based on at least one preset performance analysis indicator, the parameter information of the first network request and the parameter information of the second network request are analyzed to obtain a performance analysis result.
2. The method for analyzing network requests according to claim 1, characterized in that: The analyzing the parameter information of the first network request and the parameter information of the second network request based on at least one preset performance analysis indicator to obtain a performance analysis result includes: For each of the performance analysis indicators, based on the parameter information of the first network request and the parameter information of the second network request, calculating a change amount of the performance analysis indicator; Inputting the change amount of the performance analysis index into a preset analysis result determination model to obtain the analysis result of the performance analysis index; The analysis results of the performance analysis indicators are used as the performance analysis results.
3. The method for analyzing network requests according to claim 1, characterized in that: The method further comprises: The parameter information of the first network request and the parameter information of the second network request are stored, wherein the parameter information at least includes a target address, a request method, a response time, and a status code.
4. The method for analyzing network requests according to claim 1, characterized in that: The method further comprises: Inputting the performance analysis result into a pre-trained performance problem determination model to obtain the performance problem of the target module; or, The performance analysis result is visualized in an image format, and the performance problem of the target module is determined based on the visualized image.
5. The method for analyzing network requests according to claim 1, characterized in that: The method further comprises: Use the OHHTTPStubs component to configure the parameter information of the first network request and the parameter information of the second network request respectively, to obtain the parameter information of the first network request under multiple network conditions and the parameter information of the second network request under multiple network conditions; For each of the network conditions, based on each of the performance analysis indicators, the parameter information of the first network request under the network condition and the parameter information of the second network request under the network condition are analyzed to obtain a performance analysis result under the network condition.
6. A network request analysis device, characterized in that: The network request analysis device is applied to a server, which is connected to a client, and the device includes: A first receiving unit, configured to receive a network request analysis instruction sent by the client, wherein the network request analysis instruction is used to instruct the server to analyze a network request of an application program, wherein the network request of the application program includes identification information of a target module in the application program; A first acquisition unit, configured to acquire parameter information of a first network request initiated by the target module based on the identification information of the target module; A second receiving unit, used for a target module optimization instruction sent by the client, wherein the target module optimization instruction is used to instruct the server to optimize the target module; A second acquisition unit, configured to acquire parameter information of a second network request initiated by the optimized target module based on the target module optimization instruction; An analysis unit is used to analyze the parameter information of the first network request and the parameter information of the second network request based on at least one preset performance analysis indicator to obtain a performance analysis result.
7. The network request analysis device according to claim 6, characterized in that: The analysis unit comprises: a calculation subunit, configured to calculate, for each of the performance analysis indicators, a change amount of the performance analysis indicator based on the parameter information of the first network request and the parameter information of the second network request; An input subunit, used for inputting the variation of the performance analysis index into a preset analysis result determination model to obtain the analysis result of the performance analysis index; A determination subunit is used to use the analysis results of each of the performance analysis indicators as the performance analysis result.
8. A computer program product, characterized in that It comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the method for analyzing network requests as claimed in any one of claims 1 to 5.
9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the method for analyzing network requests as described in any one of claims 1 to 5.
10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the method for analyzing network requests as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Network policy optimization method and device, and computer readable storage medium
CN117081926A
Method and device for determining indexes of network optimization function of autonomous system
CN117295080A