# US 2025/0158909 A1 · Method and device for recording traffic, storage medium and computer device

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0158909 A1
- Document ID: US20250158909A1
- Status: Published application
- Kind: A1
- Application number: 18/733,917
- Filed: 2024-06-05
- Published: 2025-05-15
- Earliest claimed: 2023-11-13
- Assignees: Guangzhou Pinwei Software Co., Ltd.
- Applicants: Guangzhou Pinwei Software Co., Ltd.
- Inventors: Wei XU
- Web page: https://patentgrep.com/patent/US20250158909A1

## CPC

- H04L 43/0876: Network utilisation, e.g. volume of load or congestion level
- H04L 43/091: Measuring contribution of individual network components to actual service level
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

A method for recording traffic and device, a storage medium and a computer device are provided. The method includes: receiving service requests issued by application clients of the target application within a preset time period; obtaining a request interface and request parameters corresponding to each of the service request; obtaining a feature table, where the feature table includes multiple request interfaces and feature fields corresponding to the multiple request interfaces; obtaining a recording data table in a case that the request interface corresponding to each of the service request meets the preset condition; recording the service request in a case that the request interface corresponding to the service request is not included in the recording data table; and writing the recorded data into the recording data table.

## Claims

### Claim 1

A method for recording traffic, performed by a server, wherein the method comprises:
receiving, in response to a traffic recording instruction for a target application, service requests issued by all application clients of the target application within a preset time period;
obtaining a request interface and request parameters corresponding to each of the service requests;
obtaining a feature table, wherein the feature table comprises a plurality of request interfaces and feature fields corresponding to the plurality of request interfaces, and the feature fields are parameters that are comprised and of a same value in the service requests sent by the application clients to corresponding request interfaces;
for any one of the service requests,
determining whether a request interface corresponding to the service request meets a preset condition based on the feature table;
obtaining a recording data table, in a case that the request interface corresponding to the service request meets the preset condition;
determining whether the request interface corresponding to the service request is comprised in the recording data table;
recording the service request, in a case that the request interface corresponding to the service request is not comprised in the recording data table; and
writing the recorded data into the recording data table, wherein in replay testing, the recorded data is matched with the service requests issued by each of the application clients for interface testing;
wherein the determining whether a request interface corresponding to the service request meets a preset condition based on the feature table comprises:
determining whether the request interface corresponding to the service request is comprised in the feature table;
determining a target data record in a case that the request interface corresponding to the service request is comprised in the feature table, wherein the target data record is a data record that is in the feature table and corresponds to the request interface corresponding to the service request;
determining whether the request parameters of the service request comprise a request parameter the same as a feature field corresponding to the target data record;
determining that the request interface corresponding to the service request meets the preset condition, in a case that the request parameters of the service request comprise a request parameter the same as the feature field corresponding to the target data record; and
determining that the request interface corresponding to the service request does not meet the preset condition, in a case that the request parameters of the service request do not comprise the request parameter the same as the feature field corresponding to the target data record.

### Claim 2 (depends on 1)

The method for recording traffic according to claim 1, further comprising:
obtaining target request data at a scheduled time instant;
determining a preset temporary table, wherein the target request data comprises all data records in a current log of the server, and wherein each of the data records in the current log of the server comprises a request interface, request parameters and return data;
dividing, for the target request data obtained at the scheduled time instant, the target request data into a plurality of request data sets based on request interfaces comprised in the data records in the target request data, wherein the data records in a same request data set correspond to a same request interface;
for each of the plurality of request data sets,
performing feature cleaning on the request data set;
determining whether there is a feature field corresponding to the request data set based on a result of the feature cleaning;
writing, in a case that there is a feature field corresponding to the request data set, the request interface and the feature field corresponding to the request data set into the temporary table;
updating log data of the server based on the temporary table; and
updating the feature table based on the temporary table.

### Claim 3 (depends on 2)

The method for recording traffic according to claim 2, wherein the performing feature cleaning on each of the plurality of request data sets comprises:
obtaining request parameters and return data corresponding to each of data records in the request data set; and
determining a request parameter as the feature field corresponding to the request data set, in a case that the request parameter is included in each of the data records in the request data set and is of a same value in the return data corresponding to each of the data records in the request data set.

### Claim 4 (depends on 2)

The method for recording traffic according to claim 2, wherein the updating the log data of the server based on the temporary table comprises:
obtaining a first request interface, wherein the first request interface is a request interface corresponding to any one of the data records in the log data of the server; and
deleting, in a case that the first request interface is not included in the temporary table, the data record corresponding to the first request interface from the log data of the server, to update the log data of the server.

### Claim 5 (depends on 2)

The method for recording traffic according to claim 2, wherein the updating the feature table based on the temporary table comprises:
obtaining a second request interface, wherein the second request interface is a request interface corresponding to any one of data records in the feature table; and
updating, in a case that the second request interface is included in the temporary table, a feature field that is in the feature table and corresponds to the second request interface as a feature field that is in the temporary table and corresponds to the second request interface.

### Claim 6 (depends on 1)

The method for recording traffic according to claim 1, further comprising:
obtaining all data in the recording data table when the preset time period ends, wherein the data in the recording data table is configured to perform replay testing on interfaces of the application clients.

### Claim 7

A device for recording traffic, which is applied to a service, wherein the device comprises:
a request receiver, configured to receive service requests issued by all application clients of a target application within a preset time period in response to a traffic recording instruction for the target application and obtain a request interface and request parameters corresponding to each of the service requests;
a first obtainer, configured to obtain a feature table, wherein the feature table comprises a plurality of request interfaces and a feature field corresponding to the plurality of request interfaces, and the feature field is a parameter that is comprised and of a same value in the service requests sent by the application clients to corresponding request interfaces;
a determiner, configured to, for any one of the service requests, determine whether a request interface corresponding to the service request meets a preset condition based on the feature table;
a second obtainer, configured to obtain a recording data table in a case that the request interface corresponding to the service request meets the preset condition; and determine whether the request interface corresponding to the service request is comprised in the recording data table; and
a request recorder, configured to record the service request in a case that the request interface corresponding to the service request is not comprised in the recording data table; and write the recorded data into the recording data table, wherein in replay testing, the recorded data is matched with the service requests issued by each of the application clients for interface testing;
wherein the determiner is further configured to determine whether the request interface corresponding to the service request is comprised in the feature table; determine a target data record in a case that the request interface corresponding to the service request is comprised in the feature table, wherein the target data record is a data record that is in the feature table and corresponds to the request interface corresponding to the service request; determine whether the request parameters of the service request comprise a request parameter the same as a feature field corresponding to the target data record; determine that the request interface corresponding to the service request meets the preset condition, in a case that the request parameters of the service request comprise a request parameter the same as the feature field corresponding to the target data record; and determine that the request interface corresponding to the service request does not meet the preset condition, in a case that the request parameters of the service request do not comprise the request parameter the same as the feature field corresponding to the target data record.

### Claim 8

A non-transitory computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, wherein the computer-readable instructions, when executed by one or more processors, cause the one or more processors to implement a method for recording traffic, the method comprises:
receiving, in response to a traffic recording instruction for a target application, service requests issued by all application clients of the target application within a preset time period;
obtaining a request interface and request parameters corresponding to each of the service requests;
obtaining a feature table, wherein the feature table comprises a plurality of request interfaces and feature fields corresponding to the plurality of request interfaces, and the feature fields are parameters that are comprised and of a same value in the service requests sent by the application clients to corresponding request interfaces;
for any one of the service requests,
determining whether a request interface corresponding to the service request meets a preset condition based on the feature table;
obtaining a recording data table, in a case that the request interface corresponding to the service request meets the preset condition;
determining whether the request interface corresponding to the service request is comprised in the recording data table;
recording the service request, in a case that the request interface corresponding to the service request is not comprised in the recording data table; and
writing the recorded data into the recording data table, wherein in replay testing, the recorded data is matched with the service requests issued by each of the application clients for interface testing;
wherein the determining whether a request interface corresponding to the service request meets a preset condition based on the feature table comprises:
determining whether the request interface corresponding to the service request is comprised in the feature table;
determining a target data record in a case that the request interface corresponding to the service request is comprised in the feature table, wherein the target data record is a data record that is in the feature table and corresponds to the request interface corresponding to the service request;
determining whether the request parameters of the service request comprise a request parameter the same as a feature field corresponding to the target data record;
determining that the request interface corresponding to the service request meets the preset condition, in a case that the request parameters of the service request comprise a request parameter the same as the feature field corresponding to the target data record; and
determining that the request interface corresponding to the service request does not meet the preset condition, in a case that the request parameters of the service request do not comprise the request parameter the same as the feature field corresponding to the target data record.

### Claim 9 (depends on 1)

A computer device, comprising:
one or more processors; and
a memory storing computer-readable instructions, wherein the computer-readable instructions, when executed by one or more processors, cause the one or more processors to implement the method for recording traffic according to claim 1.
