[go: up one dir, main page]

CN114285731A - A kind of API request playback method, system and computer-readable storage medium - Google Patents

A kind of API request playback method, system and computer-readable storage medium Download PDF

Info

Publication number
CN114285731A
CN114285731A CN202111431445.1A CN202111431445A CN114285731A CN 114285731 A CN114285731 A CN 114285731A CN 202111431445 A CN202111431445 A CN 202111431445A CN 114285731 A CN114285731 A CN 114285731A
Authority
CN
China
Prior art keywords
api
api request
identifier
requests
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202111431445.1A
Other languages
Chinese (zh)
Inventor
杨智广
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202111431445.1A priority Critical patent/CN114285731A/en
Publication of CN114285731A publication Critical patent/CN114285731A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

本发明公开了一种API请求重放方法、系统及计算机可读存储介质,方法包括在客户端执行以下步骤:为API请求分配标识,并计算所述标识各个部分的值;将所述标识添加到所述API请求的Header;将添加了标识的API请求发送到服务器;方法还包括:在服务器执行以下步骤:从服务器日志中获取API请求,并基于API请求的标识对所述API请求进行分组;基于所述API请求的标识对每个组的API请求进行排序;对排序后的每个组的API请求进行重放。通过本发明的方案,实现了对一系列有关联的API请求的重放。

Figure 202111431445

The invention discloses an API request replay method, system and computer-readable storage medium. The method comprises the following steps: assigning an identifier to an API request, and calculating the value of each part of the identifier; adding the identifier to the Header of the API request; sending the identified API request to the server; the method further includes: performing the following steps on the server: obtaining the API request from the server log, and grouping the API request based on the API request identifier ; Sort the API requests of each group based on the identifiers of the API requests; and replay the sorted API requests of each group. Through the solution of the present invention, the replay of a series of related API requests is realized.

Figure 202111431445

Description

API request replay method, system and computer readable storage medium
Technical Field
The present invention relates to the field of computer communications technologies, and in particular, to a method and a system for replaying an API request, and a computer-readable storage medium.
Background
The HTTP-based API (Application Programming Interface) technology is a scheme adopted by most C/S architecture and B/S architecture software systems at present. When the WEB client communicates with the WEB server through the API, the WEB server records all the received requests in a log file. These log records may serve the following purposes: the method comprises the steps of monitoring system resources, auditing user behaviors, alarming suspicious behaviors, determining the scope of intrusion behaviors, providing help for system recovery, generating an investigation report and providing evidence sources for fighting against computer crimes. Generally, when a client receives abnormal information or a problem occurs in API service, the first check is the log record of the WEB server. It can be analyzed from the log record which API caused the exception for the sake of purposeful targeting. In order to find out the cause of the failure of the API service, the API request record in the log record is usually subjected to replay simulation so as to find out the problematic code segment. However, the reason for the occurrence of the exception is often not caused by one API, but by a series of APIs having a context relationship. So sometimes we cannot find the cause of the failure by simulating an API through replay. The multiple API requests triggered by the client often have complex association relationships, and the following situations may occur: one action of the WEB client can possibly trigger a plurality of parallel or sequential API requests; a complete function of the WEB client may require a user to perform multiple operations, and the time span is unlimited; the same API may be used in multiple functions; there may be an impact of the API between different functions. Because the context relation between each API request can not be obtained from the conventional API log record, only one API can be replayed and simulated, but a series of APIs with context association cannot be replayed and simulated, so that the difficulty of troubleshooting is increased to a certain extent, and the troubleshooting time is prolonged.
Disclosure of Invention
In view of the above, the present invention provides an API request replay method, system and computer-readable storage medium, which solve the problem that when an API request is replayed, only an API request causing an exception can be replayed, and an associated series of API requests cannot be replayed.
Based on the above object, an aspect of the embodiments of the present invention provides an API request replay method, where the method performs the following steps at a client:
allocating an identifier for the API request, and calculating the value of each part of the identifier;
adding the identification to a Header of the API request;
the identified API request is sent to the server.
In some embodiments, the identifying comprises: a function module number, a service operation number, a behavior operation number, and an API request timestamp.
In some embodiments, the service operation number is a universal unique identification code.
On the other hand, the embodiment of the invention also provides an API request replay method, which executes the following steps on the server:
obtaining API requests from a server log, and grouping the API requests based on the identifier of the API requests;
ordering the API requests of each group based on the identity of the API requests;
and replaying the API request of each group after the sorting.
In some embodiments, grouping API requests based on their identification includes:
and acquiring the functional module number and the service operation number of the API request from the identifier of the API request, and grouping the API request based on the functional module number and the service operation number.
In some embodiments, ordering the API requests of each group based on the identification of the API requests comprises:
and acquiring a behavior operation number and an API request timestamp of the API request from the identifier of the API request, and sequencing the API requests of each group based on the behavior operation number and the API request timestamp.
In some embodiments, grouping API requests based on the functional module number and the business operation number comprises:
and distributing the API requests with the consistent functional module numbers and the consistent service operation numbers to the same group.
In another aspect of the embodiments of the present invention, there is also provided an API request replay system, where the replay system includes a client, and the client includes:
the distribution module is configured to distribute identifiers for the API requests and calculate values of all parts of the identifiers;
an add module configured to add the identification to a Header of the API request;
a sending module configured to send the API request with the identification added to a server.
In another aspect of the embodiments of the present invention, there is also provided an API request replay system, where the replay system includes a server, and the server includes:
the grouping module is configured to acquire the API requests from the server log and group the API requests based on the identifier of the API requests;
an ordering module configured to order the API requests of each group based on the identity of the API requests;
a replay module configured to replay the ordered API requests of each group.
In another aspect of the embodiments of the present invention, a computer-readable storage medium is further provided, in which a computer program for implementing the following method steps when executed by a processor is stored:
the method comprises the following steps of:
allocating an identifier for the API request, and calculating the value of each part of the identifier;
adding the identification to a Header of the API request;
the identified API request is sent to the server.
In some embodiments, the identifying comprises: a function module number, a service operation number, a behavior operation number, and an API request timestamp.
In some embodiments, the service operation number is a universal unique identification code.
The method executes the following steps at the server:
obtaining API requests from a server log, and grouping the API requests based on the identifier of the API requests;
ordering the API requests of each group based on the identity of the API requests;
and replaying the API request of each group after the sorting.
In some embodiments, grouping API requests based on their identification includes:
and acquiring the functional module number and the service operation number of the API request from the identifier of the API request, and grouping the API request based on the functional module number and the service operation number.
In some embodiments, ordering the API requests of each group based on the identification of the API requests comprises:
and acquiring a behavior operation number and an API request timestamp of the API request from the identifier of the API request, and sequencing the API requests of each group based on the behavior operation number and the API request timestamp.
In some embodiments, grouping API requests based on the functional module number and the business operation number comprises:
and distributing the API requests with the consistent functional module numbers and the consistent service operation numbers to the same group.
The invention has at least the following beneficial technical effects: the client establishes the personalized identifier of the API request and calculates the value of the personalized identifier, so that different API requests can be distinguished, and a basis is provided for a subsequent server to replay the associated API request; the server obtains a series of API requests with context association by attributing the API requests with the same function module number and the same service operation number to the same group and sequencing each API request according to the behavior operation number and the API request timestamp in the same group, thereby providing convenience for positioning faults through API replay and shortening troubleshooting time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a block diagram of one embodiment of an API request replay method provided by the present invention;
FIG. 2 is a block diagram of one embodiment of an API request replay method provided by the present invention;
FIG. 3 is a schematic diagram illustrating one embodiment of an API request replay system provided by the present invention;
FIG. 4 is a schematic diagram illustrating one embodiment of an API request replay system provided by the present invention;
fig. 5 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
For better understanding of the embodiments of the present invention, related technical terms related to the embodiments of the present invention are described below.
API: application Programming Interface is some predefined interfaces (such as functions, HTTP interfaces), or refers to the convention for linking different components of a software system. The API is a set of definitions, procedures and protocols, and implements the communication between the computer software through the API. One of the primary functions of an API is to provide a common set of functions. The API is also a middleware and provides data sharing for various platforms. The API described herein refers specifically to the HTTP interface.
And (3) replaying: the actions that have occurred are re-executed. In this context, API replay refers to re-simulating transmission of a series of API requests that have already occurred.
API logging: the access log recorded by the server for a series of API requests typically contains request methods, request addresses, request times, request parameters, client information, and the like.
C/S architecture: in the Client-Server architecture, an application program is divided into two parts, namely a Server part and a Client part, in a C/S structure. The server part is information and functions shared by a plurality of users, and executes background services, such as controlling the operation of a shared database and the like; the client part is exclusive to the user and is responsible for executing foreground functions, has powerful functions in the aspects of error prompt, online help and the like, and can be freely switched among subprograms.
B/S architecture: the browser and server architecture mode is a changed or improved architecture of the C/S architecture along with the rise of Internet technology. Under the structure, the user work interface is realized through a WEB browser. The B/S architecture is a network architecture mode after WEB is started, and a WEB browser is the most main application software of a client. The mode unifies the client, centralizes the core part of the system function realization to the server, and simplifies the development, maintenance and use of the system.
A WEB server: a WEB server refers to a program that resides on some type of computer on the internet. When a WEB browser, i.e. a client, connects to a server and requests a file, the server will process the request and feed the file back to the browser, with accompanying information telling the browser how to view the file (i.e. the file type). The server uses HTTP (Hyper Text Transport Protocol) to communicate with the client, which is why people often refer to them as HTTP servers.
UUID: the abbreviation of universal Unique Identifier (universal Unique Identifier) can enable all elements in the distributed system to have Unique identification information without specifying the identification information through a central control end.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In view of the above objects, a first aspect of embodiments of the present invention proposes an embodiment of an API request replay method. As shown in fig. 1, the method performs the following steps at the client:
step S101, allocating identifiers for API requests, and calculating values of all parts of the identifiers;
step S103, adding the identifier to a Header of the API request;
and step S105, sending the API request added with the identifier to a server.
And adding a characteristic identifier for the API request according to the function of the WEB client and the user operation, sending the API request added with the identifier to a WEB server, recording the API request in a log after the WEB server receives the API request, and extracting a series of APIs with context association from the log record according to the identifier to perform replay simulation.
The Header is a part of the API request and is used for storing the identifier of the API request and adopts a key-value pair format.
In the actual development process, there are many cases of the trigger mechanism of one API request. The identifier of the API request includes a tag for distinguishing each identifier, and is used to record a condition that the WEB client triggers the API request, for example, what kind of function is triggered when the WEB client implements, and the operation of the same function is triggered multiple times, and the trigger time is the trigger time.
According to the embodiment of the invention, the client establishes the personalized identifier of the API request and calculates the value of the personalized identifier, so that different API requests can be distinguished, and a basis is provided for the subsequent server to replay the associated API request.
In some embodiments, the identifying comprises: a function module number, a service operation number, a behavior operation number, and an API request timestamp.
In some embodiments, the service operation number is a universal unique identification code.
The same API request may be used by different functional modules, each of which is a complete business process, such as creating a user, publishing an article, creating a container, and the like. The business operation refers to a plurality of operations performed by a user on the same functional module, such as creating a plurality of users. Behavioral operations refer to actions triggered automatically by software or actively by a user, such as initialization, mouse clicks, page scrolling, and the like.
In order to fully resolve the context relationship of a series of APIs, the identifier of the API has the following characteristics: can reflect which functional module the API request belongs to; the API request can be reflected by which business operation is triggered; can reflect what behavior operation the API request is triggered by; it can be reflected when the API request is triggered.
Based on the characteristics, the identifier of the API request is defined to comprise the following four parts of information: function module number (name), service operation number, behavior operation number, API request timestamp.
The identification format is: numbering functional modules; a service operation number; a behavior operation number; the API requests a timestamp, with an english semicolon (;) as a separator, for splicing each portion of content.
The specific process of calculating the value identifying each part is as follows:
the number of the functional module does not specify a specific format, and is defined by the user according to the system requirements, for example, the user-creation represents the functional module of the created user; the service operation number is in the form of a UUID, and each service operation generates a new UUID, such as 62b52e66-a372-4b32-81d6-ae13b57720c 6. The behavior operation number adopts a definition with self-descriptive property, such as using "initial" to represent function module initialization, using "button ═ button name" to represent button name click; the API request timestamp is defined as a digital timestamp representing the timestamp of the API request sent, which has a value of 13 bits, such as 1636620401038.
The final API identification is thus calculated as:
user-creation;62b52e66-a372-4b32-81d6-ae13b57720c6;button=buttonName;1636620401038。
and adding the calculated API identification to a Header, wherein the Header adopts a KEY-value pair form and is a KEY: VALUE; the KEY is a KEY name, which can be freely defined, for example, the KEY name is X-Request-Identification, and the VALUE stores an identifier of the API Request.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 2, an embodiment of the present invention further provides an API request replay method, which performs the following steps at a server:
step S201, obtaining an API request from a server log, and grouping the API request based on the identifier of the API request;
step S203, sequencing the API requests of each group based on the identification of the API requests;
and step S205, replaying the API request of each group after sorting.
According to the embodiment of the invention, the server obtains the API requests from the server log, groups the API requests based on the identifier of the API request and sequences the API requests of each group, so that the replay of a series of context-related API requests is realized.
In some embodiments, grouping API requests based on their identification includes:
and acquiring the functional module number and the service operation number of the API request from the identifier of the API request, and grouping the API request based on the functional module number and the service operation number.
In some embodiments, ordering the API requests of each group based on the identification of the API requests comprises:
and acquiring a behavior operation number and an API request timestamp of the API request from the identifier of the API request, and sequencing the API requests of each group based on the behavior operation number and the API request timestamp.
Furthermore, in each group of API requests, the API requests with the same operation behavior number are arranged according to the sequence of the API request time stamps.
In some embodiments, grouping API requests based on the functional module number and the business operation number comprises:
and distributing the API requests with the consistent functional module numbers and the consistent service operation numbers to the same group.
In the embodiment of the invention, the API requests with the same functional module number and the same service operation number belong to the same group, and each API request is sequenced in the same group according to the behavior operation number and the API request timestamp, so that a series of API requests with context correlation are obtained, and convenience is provided for searching for faults through API replay.
Furthermore, the replay method of the embodiment facilitates the developer to locate the bug of the software on the one hand. Through API replay, the whole business operation can be completely reproduced, so that a developer can be helped to completely analyze the whole business unit code, and deep mining of faults caused by mutually influencing or API with context relation is facilitated. In a complex use scene of a client site, the reason of the defect of the positioning software is often required to be fully communicated with the client so as to know what operation causes the fault, and great convenience is brought to fault positioning.
The playback method of the present embodiment on the other hand facilitates user behavior analysis. In the past user behavior analysis, a software designer needs to go to a customer line to do sufficient research and analysis to know what the software has the defects so as to optimize the software. Now, by replaying the API, each operation performed by the user in the software, such as when the client is used to use the software, which function modules are frequently used, which service operations are frequently interrupted, and which service operations are most time consuming, can be completely analyzed from the API replay process.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 3, an embodiment of the present invention further provides an API request replay system, the replay system including a client, the client including:
an allocation module 110, wherein the allocation module 110 is configured to allocate identifiers for API requests and calculate values of respective portions of the identifiers;
an add module 120, the add module 120 configured to add the identification to a Header of the API request;
a sending module 130, wherein the sending module 130 is configured to send the API request added with the identifier to the server.
According to the embodiment of the invention, the client establishes the personalized identifier of the API request and calculates the value of the personalized identifier, so that different API requests can be distinguished, and a basis is provided for the subsequent server to replay the associated API request.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 4, an embodiment of the present invention further provides an API request replay system, the replay system including a server, the server including:
a grouping module 210, wherein the grouping module 210 is configured to obtain API requests from a server log and group the API requests based on their identities;
an ordering module 220, the ordering module 220 configured to order the API requests of each group based on the identity of the API requests;
a replay module 230, said replay module 230 configured to replay the ordered API requests of each group.
According to the embodiment of the invention, the server obtains the API requests from the server log, groups the API requests based on the identifier of the API request and sequences the API requests of each group, so that the replay of a series of context-related API requests is realized.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 4, an embodiment of the present invention further provides a computer-readable storage medium 40, the computer-readable storage medium 40 storing a computer program 410 which, when executed by a processor, performs the following method:
the method comprises the following steps of:
allocating an identifier for the API request, and calculating the value of each part of the identifier;
adding the identification to a Header of the API request;
the identified API request is sent to the server.
In some embodiments, the identifying comprises: a function module number, a service operation number, a behavior operation number, and an API request timestamp.
In some embodiments, the service operation number is a universal unique identification code.
The method executes the following steps at the server:
obtaining API requests from a server log, and grouping the API requests based on the identifier of the API requests;
ordering the API requests of each group based on the identity of the API requests;
and replaying the API request of each group after the sorting.
In some embodiments, grouping API requests based on their identification includes:
and acquiring the functional module number and the service operation number of the API request from the identifier of the API request, and grouping the API request based on the functional module number and the service operation number.
In some embodiments, ordering the API requests of each group based on the identification of the API requests comprises:
and acquiring a behavior operation number and an API request timestamp of the API request from the identifier of the API request, and sequencing the API requests of each group based on the behavior operation number and the API request timestamp.
In some embodiments, grouping API requests based on the functional module number and the business operation number comprises:
and distributing the API requests with the consistent functional module numbers and the consistent service operation numbers to the same group.
The embodiment of the invention also can comprise corresponding computer equipment. The computer device comprises a memory, at least one processor and a computer program stored on the memory and executable on the processor, the processor executing the program to perform any one of the following methods:
the method comprises the following steps of:
allocating an identifier for the API request, and calculating the value of each part of the identifier;
adding the identification to a Header of the API request;
the identified API request is sent to the server.
In some embodiments, the identifying comprises: a function module number, a service operation number, a behavior operation number, and an API request timestamp.
In some embodiments, the service operation number is a universal unique identification code.
The method executes the following steps at the server:
obtaining API requests from a server log, and grouping the API requests based on the identifier of the API requests;
ordering the API requests of each group based on the identity of the API requests;
and replaying the API request of each group after the sorting.
In some embodiments, grouping API requests based on their identification includes:
and acquiring the functional module number and the service operation number of the API request from the identifier of the API request, and grouping the API request based on the functional module number and the service operation number.
In some embodiments, ordering the API requests of each group based on the identification of the API requests comprises:
and acquiring a behavior operation number and an API request timestamp of the API request from the identifier of the API request, and sequencing the API requests of each group based on the behavior operation number and the API request timestamp.
In some embodiments, grouping API requests based on the functional module number and the business operation number comprises:
and distributing the API requests with the consistent functional module numbers and the consistent service operation numbers to the same group.
The memory, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the API request replay method in the embodiments of the present application. The processor executes various functional applications of the apparatus and data processing, i.e., the API request replay method of the above-described method embodiments, by running the nonvolatile software program, instructions, and modules stored in the memory.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the device, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and such remote memory may be coupled to the local module via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Finally, it should be noted that, as will be understood by those skilled in the art, all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1.一种API请求重放方法,其特征在于,在客户端执行以下步骤:1. an API request replay method, is characterized in that, performs the following steps at client side: 为API请求分配标识,并计算所述标识各个部分的值;Allocate an identifier for the API request, and calculate the value of each part of the identifier; 将所述标识添加到所述API请求的Header;adding the identifier to the Header of the API request; 将添加了标识的API请求发送到服务器。Send the API request with the logo added to the server. 2.根据权利要求1所述的方法,其特征在于,所述标识包括:功能模块编号、业务操作编号、行为操作编号以及API请求时间戳。2 . The method according to claim 1 , wherein the identification comprises: a function module number, a business operation number, a behavior operation number, and an API request timestamp. 3 . 3.根据权利要求2所述的方法,其特征在于,所述业务操作编号为通用唯一标识码。3. The method according to claim 2, wherein the service operation number is a universal unique identification code. 4.一种API请求重放方法,其特征在于,在服务器执行以下步骤:4. an API request replay method, is characterized in that, performs the following steps at the server: 从服务器日志中获取API请求,并基于API请求的标识对所述API请求进行分组;Obtain API requests from server logs, and group the API requests based on the API request identifiers; 基于所述API请求的标识对每个组的API请求进行排序;sorting the API requests for each group based on the identity of the API request; 对排序后的每个组的API请求进行重放。Replays the API requests for each group after sorting. 5.根据权利要求4所述的方法,其特征在于,基于API请求的标识对所述API请求进行分组包括:5. The method according to claim 4, wherein the grouping of the API request based on the identifier of the API request comprises: 从所述API请求的标识获取所述API请求的功能模块编号和业务操作编号,基于所述功能模块编号和所述业务操作编号对API请求进行分组。The function module number and business operation number of the API request are obtained from the identifier of the API request, and the API requests are grouped based on the function module number and the business operation number. 6.根据权利要求5所述的方法,其特征在于,基于所述API请求的标识对每个组的API请求进行排序包括:6. The method according to claim 5, wherein sorting the API requests of each group based on the identifiers of the API requests comprises: 从所述API请求的标识获取所述API请求的行为操作编号和API请求时间戳,基于所述行为操作编号和所述API请求时间戳对所述每个组的API请求进行排序。The behavior operation number and API request timestamp of the API request are obtained from the identifier of the API request, and the API requests of each group are sorted based on the behavior operation number and the API request timestamp. 7.根据权利要求5所述的方法,其特征在于,基于所述功能模块编号和所述业务操作编号对API请求进行分组包括:7. The method according to claim 5, wherein the grouping of the API request based on the functional module number and the business operation number comprises: 将所述功能模块编号一致且所述业务操作编号一致的API请求分到同一组。The API requests with the same function module numbers and the same business operation numbers are grouped into the same group. 8.一种API请求重放系统,所述重放系统包括客户端,其特征在于,所述客户端包括:8. An API request playback system, the playback system comprising a client, wherein the client comprises: 分配模块,所述分配模块配置为为API请求分配标识,并计算所述标识各个部分的值;an allocation module, the allocation module is configured to allocate an identifier for the API request, and calculate the value of each part of the identifier; 添加模块,所述添加模块配置为将所述标识添加到所述API请求的Header;An adding module, the adding module is configured to add the identifier to the Header of the API request; 发送模块,所述发送模块配置为将添加了标识的API请求发送到服务器。A sending module, where the sending module is configured to send the identified API request to the server. 9.一种API请求重放系统,所述重放系统包括服务器,其特征在于,所述服务器包括:9. A system for replaying an API request, the replaying system comprising a server, wherein the server comprises: 分组模块,所述分组模块配置为从服务器日志中获取API请求,并基于API请求的标识对所述API请求进行分组;a grouping module, the grouping module is configured to obtain the API request from the server log, and group the API request based on the identifier of the API request; 排序模块,所述排序模块配置为基于所述API请求的标识对每个组的API请求进行排序;a sorting module, the sorting module is configured to sort the API requests of each group based on the identifiers of the API requests; 重放模块,所述重放模块配置为对排序后的每个组的API请求进行重放。A replay module, the replay module is configured to replay the sorted API requests of each group. 10.一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时执行如权利要求1-3或4-7任意一项所述的方法的步骤。10. A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, any one of claims 1-3 or 4-7 is executed. steps of the method described.
CN202111431445.1A 2021-11-29 2021-11-29 A kind of API request playback method, system and computer-readable storage medium Withdrawn CN114285731A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111431445.1A CN114285731A (en) 2021-11-29 2021-11-29 A kind of API request playback method, system and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111431445.1A CN114285731A (en) 2021-11-29 2021-11-29 A kind of API request playback method, system and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN114285731A true CN114285731A (en) 2022-04-05

Family

ID=80870231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111431445.1A Withdrawn CN114285731A (en) 2021-11-29 2021-11-29 A kind of API request playback method, system and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN114285731A (en)

Similar Documents

Publication Publication Date Title
US7805675B2 (en) Methods, systems, and computer program products for recreating events occurring within a web application
JP5354776B2 (en) Distributed acquisition and aggregation of dynamic application usage information
US10402302B1 (en) Reproduction of testing scenarios in a continuous integration environment
Vallee et al. A framework for proactive fault tolerance
CN108696399B (en) Business service test method and device
US20200379871A1 (en) Object model based issue triage
US20180210745A1 (en) Virtual service interface
CN114064475B (en) Cloud native application testing method, device, equipment and storage medium
Kälber et al. Forensic application-fingerprinting based on file system metadata
JP7619744B2 (en) Fault Localization for Cloud-Native Applications
US10387370B2 (en) Collecting test results in different formats for storage
CN114546814A (en) Recording playback method, recording playback device and storage medium
CN115766258B (en) Multi-stage attack trend prediction method, equipment and storage medium based on causal relationship graph
CN113411206B (en) Log auditing method, device, equipment and computer storage medium
CN104539449A (en) A fault information processing method and related device
US8984157B2 (en) Network analysis in a file transfer system
CN114285731A (en) A kind of API request playback method, system and computer-readable storage medium
JP4734454B2 (en) System analysis program, system analysis method, and system analysis apparatus
CN117806970A (en) Buried point verification method, buried point verification device, electronic equipment and storage medium
CN113031960B (en) Code compiling method, device, server and storage medium
CN116166534A (en) Regression testing method, device and equipment
CN115774739A (en) Transaction data tracking method and device
JP6070338B2 (en) Classification device for processing system included in multi-tier system, classification program for processing system included in multi-tier system, and classification method for processing system included in multi-tier system
CN113918204A (en) A metadata script management method, apparatus, electronic device and storage medium
CN113778709A (en) Interface calling method, device, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20220405