Transaction flow playback method and device, program product and electronic equipment
By obtaining and replaying transaction traffic data from the preset database and sequentially based on traffic requests, the problem of high failure rate of transaction traffic replay in the existing technology is solved, and efficient and accurate transaction traffic replay is achieved.
Patent Information
- Application Number
- CN202411729403.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-28
AI Technical Summary
In the prior art, the failure rate of transaction traffic replay is high, and it is impossible to accurately simulate the actual production and trading scenarios.
By receiving the traffic playback task, the target traffic data generated by the target transaction indicated by the transaction identification in the preset database are determined from the preset database and the target traffic data generated during the playback time period, and the traffic request sequence is performed.
Real simulation of transactions is realized, the replay success rate and replay processing performance of business transactions are improved, and the replay failure rate is reduced.
Smart Images

Figure CN119718913A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial technology, and in particular to a transaction flow playback method and device, program product, and electronic device thereof. Background Art
[0002] Currently, the business systems of financial institutions usually require a large number of transaction tests or transaction flow playbacks to detect system performance, measure system performance, and determine the optimal capacity of the system.
[0003] After the business system is launched, the system transaction volume will increase with the increase of business volume. Traffic playback is an important means to test system capacity and performance. Capacity testing of the business system can discover the capacity bottlenecks that may exist in the business system in advance and provide a decision-making basis for expanding the business system. When a business system fails, if the transaction flow where the business system fails can be reproduced, the cause of the failure can be quickly located, speeding up troubleshooting and recovery.
[0004] In the related art, traffic recording and playback tools are generally used to play back transaction traffic. In the workflow, the traffic recording and playback tool first captures network traffic and stores it in the storage node. When the user triggers the playback function, the traffic will be sent directly and in batches to the service node.
[0005] However, although the above method is relatively simple, it cannot meet the expected effect of users. The main problem is that the above method cannot accurately simulate the actual production transaction scenario. In addition, due to the interdependence between service calls, this batch playback method is prone to increase the playback failure rate.
[0006] To the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0007] The embodiments of the present invention provide a transaction flow playback method and device, program product, and electronic device, so as to at least solve the technical problem of high failure rate in transaction flow playback in related technologies.
[0008] According to one aspect of an embodiment of the present application, a method for replaying transaction traffic is provided, including: receiving a traffic replay task, wherein the traffic replay task carries at least: a transaction identifier and a replay time period; determining from a preset database target traffic data generated by a target transaction indicated by the transaction identifier during the replay time period, wherein the preset database pre-stores traffic data generated by various transactions during different time periods and a traffic request sequence corresponding to the traffic data of each transaction; based on the traffic request sequence, replaying the target traffic data to complete the simulation of the target transaction.
[0009] In one embodiment of the present application, before receiving the traffic playback task, it also includes: when a recording task is received, the ongoing transaction is recorded to obtain the traffic data of the transaction, wherein the traffic data includes: multiple traffic requests, each traffic request corresponds to traffic request information and a link identifier, and the traffic request information includes at least: transaction time; the traffic data of each recorded transaction is stored in a preset database.
[0010] In one embodiment of the present application, after storing the recorded traffic data of each transaction in a preset database, it also includes: for each transaction, integrating all traffic requests corresponding to the same link identifier to obtain a message of the link indicated by the link identifier; based on the transaction time, determining the association order between all traffic requests in each message, and determining the link execution order between each link; based on the link execution order and the association order of each message, determining the traffic request order of the transaction; storing the traffic request order of each transaction in the preset database.
[0011] In one embodiment of the present application, before determining from a preset database the target traffic data generated by the target transaction indicated by the transaction identifier during the playback time period, it also includes: splitting the traffic playback task into multiple subtasks, wherein each subtask carries a set of traffic request identifiers to be obtained; assigning each subtask to a subtask executor, wherein the subtask executor obtains, based on the subtask, the target traffic request corresponding to each traffic request identifier to be obtained in the set of traffic request identifiers to be obtained from the preset database; all the obtained target traffic requests constitute the target traffic data.
[0012] In one embodiment of the present application, the step of splitting the traffic playback task into multiple subtasks includes: determining the amount of data generated by the target transaction in the playback time period; splitting the traffic playback task based on the data amount to obtain a preset number of traffic requests to be obtained for each subtask, and allocating a preset number of traffic request identifiers to be obtained to each subtask; or, dividing the playback time period into multiple playback time intervals; splitting the traffic playback task based on each playback time interval to obtain the transaction time of the traffic request to be obtained for each subtask; and allocating the traffic request identifier to be obtained corresponding to each transaction time to the subtask.
[0013] In one embodiment of the present application, after obtaining the target traffic request corresponding to each traffic request identifier to be obtained in the set of traffic request identifiers to be obtained from a preset database, it also includes: storing the obtained target traffic request into a preset delay queue, and recording the storage duration of the target traffic request; when the storage duration reaches the preset delay duration, obtaining the target traffic request from the preset delay queue.
[0014] In one embodiment of the present application, the step of replaying the target traffic data based on the traffic request order includes: determining the current link where the target traffic request obtained from the preset delay queue is located; judging whether all traffic requests corresponding to all links before the current link have been replayed based on the traffic request order; if all traffic requests corresponding to all links before the current link have been replayed, judging whether all traffic requests before the target traffic request on the current link have been replayed based on the traffic request order; if all traffic requests before the target traffic request on the current link have been replayed, replaying the target traffic request; judging whether the preset delay queue is an empty queue, and if the preset delay queue is not an empty queue, continuing to obtain new target traffic requests whose storage time reaches the preset delay time from the preset delay queue until the preset delay queue is an empty queue, thereby completing the replay of the target traffic data.
[0015] According to another aspect of an embodiment of the present application, a playback device for transaction traffic is also provided, including: a receiving unit, used to receive a traffic playback task, wherein the traffic playback task carries at least: a transaction identifier, a playback time period; a determination unit, used to determine from a preset database target traffic data generated by a target transaction indicated by the transaction identifier during the playback time period, wherein the preset database pre-stores traffic data generated by various transactions in different time periods and a traffic request sequence corresponding to the traffic data of each transaction; a playback unit, used to play back the target traffic data based on the traffic request sequence to complete the simulation of the target transaction.
[0016] In one embodiment of the present application, the playback device also includes: a first recording module, which is used to record the ongoing transaction before receiving the traffic playback task and obtain the traffic data of the transaction when the recording task is received, wherein the traffic data includes: multiple traffic requests, each traffic request corresponds to traffic request information and a link identifier, and the traffic request information includes at least: transaction time; a first storage module, which is used to store the recorded traffic data of each transaction into a preset database.
[0017] In one embodiment of the present application, the playback device also includes: a first integration module, which is used to integrate all traffic requests corresponding to the same link identifier for each transaction after storing the recorded traffic data of each transaction in a preset database, so as to obtain a message of the link indicated by the link identifier; a first determination module, which is used to determine the association order between all traffic requests in each message based on the transaction time, and determine the link execution order between each link; a second determination module, which is used to determine the traffic request order of the transaction based on the link execution order and the association order of each message; and a second storage module, which is used to store the traffic request order of each transaction in the preset database.
[0018] In one embodiment of the present application, the playback device also includes: a first splitting module, which is used to split the traffic playback task into multiple sub-tasks before determining the target traffic data generated by the target transaction indicated by the transaction identifier in the playback time period from a preset database, wherein each sub-task carries a set of traffic request identifiers to be obtained; a first allocation module, which is used to assign each sub-task to a sub-task executor, wherein the sub-task executor obtains the target traffic request corresponding to each traffic request identifier to be obtained in the set of traffic request identifiers to be obtained from the preset database based on the sub-task; all the obtained target traffic requests constitute the target traffic data.
[0019] In one embodiment of the present application, a first splitting module includes: a first determination submodule, used to determine the amount of data generated by a target transaction in a playback time period; a first splitting submodule, used to split the traffic playback task based on the data volume, obtain a preset number of traffic requests to be acquired for each subtask, and allocate a preset number of traffic request identifiers to be acquired for each subtask; a first division submodule, used to divide the playback time period into multiple playback time intervals; a second splitting submodule, used to split the traffic playback task based on each playback time interval, and obtain the transaction time of the traffic request to be acquired for each subtask; a first allocation submodule, used to allocate the traffic request identifier to be acquired corresponding to each transaction time to the subtask.
[0020] In one embodiment of the present application, the playback device also includes: a first storage module, which is used to store the acquired target traffic request into a preset delay queue after acquiring the target traffic request corresponding to each traffic request identifier in the set of traffic request identifiers to be acquired from a preset database, and record the storage duration of the target traffic request; a first acquisition module, which is used to acquire the target traffic request from the preset delay queue when the storage duration reaches the preset delay duration.
[0021] In one embodiment of the present application, the playback unit includes: a third determination module, which is used to determine the current link where the target traffic request obtained from the preset delay queue is located; a first judgment module, which is used to determine whether all traffic requests corresponding to all links before the current link have been replayed based on the traffic request order; a second judgment module, which is used to determine whether all traffic requests on the current link before the target traffic request have been replayed based on the traffic request order when all traffic requests corresponding to all links before the current link have been replayed; the first playback module is used to replay the target traffic request when all traffic requests on the current link before the target traffic request have been replayed; a third judgment module, which is used to determine whether the preset delay queue is an empty queue, and when the preset delay queue is not an empty queue, continue to obtain new target traffic requests with a storage time reaching the preset delay time from the preset delay queue until the preset delay queue is an empty queue, thereby completing the playback of the target traffic data.
[0022] According to another aspect of an embodiment of the present application, a computer program product is also provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements any of the above-mentioned transaction flow playback methods.
[0023] According to another aspect of an embodiment of the present application, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned transaction flow playback methods.
[0024] In the present invention, by receiving a traffic playback task, the target traffic data generated by the target transaction indicated by the transaction identifier during the playback time period is determined from a preset database, and the target traffic data is played back based on the traffic request sequence to complete the simulation of the target transaction, thereby solving the technical problem of a high failure rate in replaying transaction traffic in related technologies.
[0025] In the present invention, by pre-storing the traffic data generated by various transactions in different time periods in a preset database, and pre-determining the traffic request order corresponding to the traffic data of each transaction, when a traffic playback task is received, the target traffic data required by the traffic playback task can be directly obtained from the preset database, and then the target traffic data can be played back according to the corresponding traffic request order. In this way, a true simulation of the transaction is achieved, the playback success rate of business transactions and the playback processing performance are improved, thereby achieving the technical effect of efficiently playing back transaction traffic. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0027] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a transaction flow playback method is shown;
[0028] Figure 2 is a flow chart of a method for replaying transaction traffic according to Embodiment 1 of the present application;
[0029] Figure 3 is a schematic diagram of the system architecture of the traffic recording and playback management process according to Example 1 of the present application;
[0030] Figure 4 is a schematic diagram of an optional transaction flow playback device according to an embodiment of the present application;
[0031] Figure 5 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] It should be noted that the transaction flow replay method and device in the present invention can be used in financial technology when replaying transaction flow, and can also be used in any field other than financial technology when replaying transaction flow. The present invention does not limit the application field of the transaction flow replay method and device.
[0035] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) collected and involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with the relevant laws, regulations and standards of the relevant regions, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set between the system and the relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.
[0036] In the present invention, in view of the problems that traffic recording and playback tools in related technologies cannot truly simulate the scenarios of production transactions and have a high playback failure rate, a traffic playback method that can ensure the timing dependence of traffic playback is proposed, which can accurately simulate the traffic conditions of transactions in a specific time period, which is of great significance for scenarios such as system performance testing, fault reproduction and security auditing. In addition, by splitting the traffic playback task into multiple subtasks for parallel processing, the playback efficiency is effectively improved and the playback time is shortened. At the same time, by setting the preset delay queue and delay duration, the time sequence of transaction traffic can be truly restored to ensure the accuracy and reliability of playback.
[0037] The present invention is described in detail below in conjunction with various embodiments.
[0038] Example 1
[0039] According to an embodiment of the present application, an embodiment of a method for replaying transaction flow is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0040] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing a transaction flow playback method is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more ( Figure 1 102a, 102b, ..., 102n are used to illustrate) processor 102 (processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera, wherein the network interface may be connected to a wired and / or wireless network. A person of ordinary skill in the art will understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0041] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0042] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the transaction flow playback method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned transaction flow playback method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0043] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0044] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0045] Under the above operating environment, this application provides Figure 2 Replay method of transaction flow shown. Figure 2 is a flow chart of a method for replaying transaction traffic according to Example 1 of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0046] Step S201, receiving a traffic replay task, wherein the traffic replay task carries at least: a transaction identifier and a replay time period.
[0047] In an embodiment of the present invention, the transaction traffic playback method can be applied to a management platform. After receiving a traffic playback task (the task carries a transaction identifier and a playback time period), the management platform can send the traffic playback task to a task allocation node, so that the task allocation node assigns the task to the playback node, and then replays the traffic data indicated by the task through the playback node.
[0048] Step S202, determining the target traffic data generated by the target transaction indicated by the transaction identifier during the playback time period from a preset database, wherein the preset database pre-stores the traffic data generated by various transactions during different time periods and the traffic request sequence corresponding to the traffic data of each transaction.
[0049] In an embodiment of the present invention, before the task allocation node assigns a task to the playback node, the target traffic data generated by the target transaction indicated by the transaction identifier during the playback time period can be obtained from a preset database, so that the playback node can play back according to the obtained traffic data.
[0050] In the embodiment of the present invention, the preset database is pre-constructed and used to store the traffic data generated by various transactions in different time periods and the traffic request sequence corresponding to the traffic data of each transaction.
[0051] Optionally, the management platform can send the recording task to the application node. After recording the traffic data of the transaction, the application node can store it in a preset database through the storage node, and can integrate the traffic requests of the transaction through the integration node to obtain the traffic request sequence corresponding to the traffic data of the transaction.
[0052] In an embodiment of the present invention, the preset database can select a database with efficient data storage and retrieval capabilities, as well as the ability to process large-scale data, so as to facilitate subsequent rapid query and extraction of traffic data as needed, and realize the integration, sorting and playback of traffic data, thereby achieving the purpose of more realistic simulation of production transaction scenarios.
[0053] Step S203, based on the traffic request sequence, the target traffic data is replayed to complete the simulation of the target transaction.
[0054] In the embodiment of the present invention, each traffic request in the target traffic data can be replayed in time sequence according to the traffic request sequence to achieve simulation of the target transaction.
[0055] In summary, by pre-storing the traffic data generated by various transactions in different time periods in a preset database, and pre-determining the traffic request order corresponding to the traffic data of each transaction, when receiving a traffic playback task, the target traffic data required by the traffic playback task can be directly obtained from the preset database, and then the target traffic data can be replayed according to the corresponding traffic request order. In this way, a true simulation of the transaction is achieved, and the playback success rate and playback processing performance of business transactions are improved, thereby achieving the technical effect of efficiently replaying transaction traffic, and further solving the technical problem of high failure rate in replaying transaction traffic in related technologies.
[0056] In order to store traffic data and corresponding information, it is necessary to build a preset database. In the transaction traffic playback method provided in Example 1 of the present application, before receiving the traffic playback task, when receiving the recording task, the ongoing transaction is recorded to obtain the traffic data of the transaction, wherein the traffic data includes: multiple traffic requests, each traffic request corresponds to traffic request information and a link identifier, and the traffic request information includes at least: transaction time; the traffic data of each recorded transaction is stored in the preset database.
[0057] In an embodiment of the present invention, the management platform can issue a recording task. After receiving the recording task instruction, the recording tool starts to monitor and record all request data of the application node when processing the transaction. These request data are flow data. The flow data includes but is not limited to: HTTP (Hypertext Transfer Protocol Request, i.e. Hypertext Transfer Protocol Request) request, RPC (Remote Procedure Call, i.e. Remote Procedure Call) call request, etc. Each flow request carries its own flow request information, such as request method (GET, POST, etc.), request URL (Un iform Resource Locator, i.e. Uniform Resource Locator), request header, request body, response status code, response header, response body, etc., and transaction timestamp, to accurately record the time when the flow request occurs. In addition, each flow request is also associated with a link identifier, i.e. TraceId. TraceId is a unique identifier used to track a complete request link in a distributed system. It can run through the entire service call link, from the client initiating the request to the server processing and then returning the response. It is recorded and transmitted by all participating service nodes during the whole process, and is used to associate the upstream and downstream relationships of the request, facilitating subsequent flow integration. Then, the recorded traffic data is stored in the preset database, which can not only save a large amount of data efficiently, but also perform quick queries, providing convenience for subsequent data integration and playback.
[0058] In this embodiment, through precise timing recording and link tracking, as well as utilizing the efficient storage and retrieval capabilities of the preset database, a more realistic and reliable transaction scenario playback is achieved, which improves the playback success rate of business transactions and also improves the performance of playback processing, providing strong support for the verification and testing of business systems.
[0059] In order to facilitate the subsequent playback of traffic in a chronological order, in the transaction traffic playback method provided in Example 1 of the present application, after the recorded traffic data of each transaction is stored in a preset database, for each transaction, all traffic requests corresponding to the same link identifier are integrated to obtain a message of the link indicated by the link identifier; based on the transaction time, the association order between all traffic requests in each message is determined, and the link execution order between each link is determined; based on the link execution order and the association order of each message, the traffic request order of the transaction is determined; and the traffic request order of each transaction is stored in the preset database.
[0060] In an embodiment of the present invention, after the recording tool stores the traffic data of all transactions in a preset database, the management platform can issue a data integration task to integrate all related traffic requests for each transaction according to its link identifier (TraceId) to form a complete message. This process ensures that all requests with a call relationship are associated to form a complete service call link. In this embodiment, each transaction can have multiple service call links.
[0061] In this embodiment, since there is a dependency between the calls of services, the order of requests directly determines the execution process of the transaction. Therefore, correctly sorting the requests is crucial to the authenticity and success rate of the playback. Therefore, when integrating the messages, the association order between these requests can be determined according to the transaction timestamp of each traffic request, and the link execution order between each link in the same transaction can be determined. According to the association order and link execution order, the complete order of traffic requests in the transaction process (i.e., the traffic request order) can be determined, thereby ensuring that the playback can be carried out according to the real process in the production environment. Afterwards, the determined traffic request order is stored in the preset database for use during playback.
[0062] In this embodiment, the efficiency and accuracy of traffic playback are effectively improved through traffic request integration and sorting, providing a strong technical guarantee for the testing and verification of the business system.
[0063] In order to improve the efficiency of traffic playback, in the transaction traffic playback method provided in Example 1 of the present application, before determining the target traffic data generated by the target transaction indicated by the transaction identifier in the playback time period from the preset database, the traffic playback task is split into multiple subtasks, wherein each subtask carries a set of traffic request identifiers to be obtained; each subtask is assigned to a subtask executor, wherein the subtask executor obtains, based on the subtask, the target traffic request corresponding to each traffic request identifier to be obtained in the set of traffic request identifiers to be obtained from the preset database; and all the obtained target traffic requests constitute the target traffic data.
[0064] In an embodiment of the present invention, after receiving a traffic playback task from the management platform, the task allocation node will not directly put the entire task into playback at one time, but will split it into multiple subtasks. Each subtask carries a set of traffic request identifiers to be obtained, which contains a specific number of traffic request identifiers (for example, each subtask may contain 10,000 traffic request identifiers). This splitting strategy allows multiple subtasks to be processed in parallel, thereby speeding up the playback speed and improving the overall playback efficiency.
[0065] In the embodiment of the present invention, the split subtasks are polled and assigned to different subtask executors. The subtask executor is a component specifically used to execute the traffic playback subtask, and can independently obtain the target traffic request corresponding to the traffic request identifier to be obtained in the subtask from the preset database. By assigning tasks to multiple executors, load balancing can be achieved, further improving the efficiency and performance of playback.
[0066] In the embodiment of the present invention, each subtask executor reads the target flow request corresponding to each identifier in the set of flow request identifiers to be obtained from the preset database according to the assigned subtask. In this embodiment, the target flow requests obtained by all subtask executors constitute the target flow data.
[0067] In this embodiment, through the splitting and allocation strategy of traffic playback tasks, it is possible to improve playback efficiency, optimize resource utilization, enhance playback accuracy, improve scalability and simplify management processes, providing a more efficient, accurate and flexible traffic playback method for testing and verification of business systems.
[0068] In order to improve the accuracy of splitting traffic playback tasks, in the playback method of transaction traffic provided in Example 1 of the present application, the amount of data generated by the target transaction in the playback time period is determined; based on the data amount, the traffic playback task is split to obtain a preset number of traffic requests to be obtained for each subtask, and a preset number of traffic request identifiers to be obtained are assigned to each subtask; or, the playback time period is divided into multiple playback time intervals; based on each playback time interval, the traffic playback task is split to obtain the transaction time of the traffic request to be obtained for each subtask; and the traffic request identifier to be obtained corresponding to each transaction time is assigned to the subtask.
[0069] In the embodiment of the present invention, the traffic playback task can be split according to the amount of transaction data, and can also be split according to the length of the playback time period.
[0070] In the embodiment of the present invention, the amount of data generated by the target transaction during the playback time period can be determined first, and then the traffic playback task can be split into multiple subtasks (each subtask is used to obtain a preset number of traffic requests) according to the amount of data. Each subtask will be assigned a preset number of traffic request identifiers, for example, each subtask processes 10,000 traffic requests, so that the playback task can be processed evenly, avoiding delays or resource bottlenecks caused by a single subtask processing too much data.
[0071] In an embodiment of the present invention, the playback time period can also be divided into multiple playback time intervals, for example, one time interval per minute. Then, according to the playback time interval, the traffic playback task is split to obtain the traffic request related to each playback time interval (that is, the transaction time of the traffic request is within the playback time interval), and the transaction time of the traffic request in each playback time interval is recorded. Afterwards, the to-be-acquired traffic request identifier corresponding to the transaction time of the traffic request in each playback time interval is assigned to the subtask to ensure that the traffic request identifier processed by each subtask is related to a specific time interval.
[0072] In order to replay the traffic request sequence, in the transaction traffic replay method provided in Example 1 of the present application, after obtaining the target traffic request corresponding to each traffic request identifier to be obtained in the set of traffic request identifiers to be obtained from the preset database, the obtained target traffic request is stored in the preset delay queue, and the storage duration of the target traffic request is recorded; when the storage duration reaches the preset delay duration, the target traffic request is obtained from the preset delay queue.
[0073] In the embodiment of the present invention, during the traffic playback process, a preset delay queue may be used to ensure that traffic requests are played back according to the actual time sequence in the production environment.
[0074] In the embodiment of the present invention, after the subtask executor reads and obtains the corresponding target traffic request from the preset database, it will not immediately send it to the playback node for playback, but first store it in a preset delay queue. This delay queue can be a message queue that has the ability to delay message publishing and can delay publishing messages according to a set time.
[0075] Then, while storing the target traffic request in the delay queue, record the storage time of each request. When the storage time of the target traffic request in the delay queue reaches the preset delay time, the playback node can obtain the request from the delay queue and replay it in the time sequence of the production environment. In this way, it can be ensured that the time the traffic request stays in the delay queue matches the time difference from the request being sent to being received in the production environment. For example, if an RPC call in the production environment is issued at 10:02:30 am, then during the playback process, the target traffic request corresponding to the RPC call will also be taken out of the delay queue and sent after the same time difference after the playback starts.
[0076] In order to improve the accuracy of replaying the target traffic data, in the transaction traffic playback method provided in Example 1 of the present application, the current link where the target traffic request obtained from the preset delay queue is located is determined; based on the traffic request order, it is judged whether all traffic requests corresponding to all links before the current link have been replayed; when all traffic requests corresponding to all links before the current link have been replayed, based on the traffic request order, it is judged whether all traffic requests before the target traffic request on the current link have been replayed; when all traffic requests before the target traffic request on the current link have been replayed, the target traffic request is replayed; it is judged whether the preset delay queue is an empty queue, and when the preset delay queue is not an empty queue, new target traffic requests with a storage time reaching the preset delay time are continued to be obtained from the preset delay queue until the preset delay queue is an empty queue, thereby completing the playback of the target traffic data.
[0077] In the embodiment of the present invention, the link dependency and sequential playback mechanism in the traffic playback management method are the key to ensure that the service call follows the timing dependency and transaction process of the production environment during the playback process. The specific playback steps are as follows:
[0078] The playback node can first determine the current link where the target traffic request obtained from the preset delay queue is located. Then, based on the order of traffic requests, determine whether all traffic requests corresponding to all links before the current link have been fully replayed. When the playback of the preceding links (that is, all links before the current link) is completed, the playback node further determines whether all traffic requests before the target traffic request on the current link have also been replayed. After all preceding traffic requests before the target traffic request on the current link have been replayed in the correct order, the playback node will start to replay the target traffic request, thereby ensuring that the entire playback process follows the transaction flow and timing dependencies in the production environment.
[0079] Then, the playback node will continue to check whether the preset delay queue is an empty queue. If there are traffic requests to be replayed in the queue, the playback node will continue to obtain new target traffic requests from the queue whose storage time reaches the preset delay time, perform the above-mentioned link dependency judgment and playback in sequence until the queue is empty, and complete the playback of the target traffic data.
[0080] In this embodiment, the timing dependency problem of service calls is effectively handled through link dependency and sequential playback mechanism, which improves the accuracy, authenticity and system performance of playback and provides a more accurate and controllable data playback method for testing and verification of business systems.
[0081] Figure 3 is a schematic diagram of the system architecture of the flow recording and playback management process according to Example 1 of the present application, such as Figure 3 As shown, it includes: management platform, application node, storage node, database, integration node, task allocation node, subtask executor, and playback node. Among them, the management platform is responsible for the scheduling and control of the entire traffic playback, and is used to issue recording tasks to application nodes, integration tasks to integration nodes, and playback tasks to task allocation nodes, so as to guide the nodes in the entire process to execute as planned. The application node is responsible for recording traffic, and collects and prepares traffic data in the production environment by monitoring or capturing it for subsequent playback management. The storage node is connected to the application node and is used to store the traffic data recorded by the application node in the database. The integration node is used to integrate traffic under the same TraceId and store the integrated traffic data back to the database. The task allocation node listens to the playback task issued by the management platform. When the playback task starts, the task allocation node will start the playback timing task, split the subtasks according to the amount of data traded in the database, and assign the subtasks to the subtask executor by polling to ensure the parallel processing of the playback task. The subtask executor reads the corresponding traffic data from the database according to the assigned subtasks and stores it in the preset delay queue. The playback node is responsible for obtaining expired data from the delay queue and playing it back in the order of the integrated and sorted traffic.
[0082] The transaction traffic playback method provided in the embodiment of the present application stores the traffic data generated by various transactions in different time periods in a preset database in advance, and predetermines the traffic request sequence corresponding to the traffic data of each transaction. When a traffic playback task is received, the target traffic data required by the traffic playback task can be directly obtained from the preset database, and then the target traffic data can be played back according to the corresponding traffic request sequence. In this way, a true simulation of the transaction is achieved, and the playback success rate and playback processing performance of the business transaction are improved, thereby achieving the technical effect of efficiently playing back the transaction traffic, and further solving the technical problem of a high failure rate in playing back the transaction traffic in the related technology.
[0083] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0084] Example 2
[0085] The embodiment of the present application also provides a transaction flow playback device. It should be noted that the transaction flow playback device of the embodiment of the present application can be used to execute the transaction flow playback method provided in the embodiment of the present application. The transaction flow playback device provided in the embodiment of the present application is introduced below.
[0086] According to an embodiment of the present application, a device for implementing the above-mentioned transaction flow playback method is also provided. Figure 4 is a schematic diagram of an optional transaction flow playback device according to an embodiment of the present application, such as Figure 4 As shown, the playback device may include: a receiving unit 40, a determining unit 41, and a playback unit 42.
[0087] The receiving unit 40 is used to receive a traffic playback task, wherein the traffic playback task carries at least: a transaction identifier and a playback time period;
[0088] The determination unit 41 is used to determine the target flow data generated by the target transaction indicated by the transaction identifier in the playback time period from a preset database, wherein the preset database pre-stores the flow data generated by various transactions in different time periods and the flow request sequence corresponding to the flow data of each transaction;
[0089] The playback unit 42 is used to play back the target traffic data based on the traffic request sequence to complete the simulation of the target transaction.
[0090] The transaction flow playback device provided in the embodiment of the present application stores the flow data generated by various transactions in different time periods in a preset database in advance, and predetermines the flow request sequence corresponding to the flow data of each transaction. When a flow playback task is received, the device can directly obtain the target flow data required by the flow playback task from the preset database, and then play back the target flow data according to the corresponding flow request sequence. In this way, a true simulation of the transaction is achieved, and the playback success rate and playback processing performance of the business transaction are improved, thereby achieving the technical effect of efficiently playing back the transaction flow, and further solving the technical problem of a high failure rate in playing back the transaction flow in the related technology.
[0091] Optionally, the playback device also includes: a first recording module, used to record the ongoing transaction before receiving the traffic playback task and obtain the traffic data of the transaction when the recording task is received, wherein the traffic data includes: multiple traffic requests, each traffic request corresponds to traffic request information and a link identifier, and the traffic request information includes at least: transaction time; a first storage module, used to store the recorded traffic data of each transaction into a preset database.
[0092] Optionally, the playback device also includes: a first integration module, which is used to integrate all traffic requests corresponding to the same link identifier for each transaction after storing the recorded traffic data of each transaction in a preset database, so as to obtain the message of the link indicated by the link identifier; a first determination module, which is used to determine the association order between all traffic requests in each message based on the transaction time, and determine the link execution order between each link; a second determination module, which is used to determine the traffic request order of the transaction based on the link execution order and the association order of each message; and a second storage module, which is used to store the traffic request order of each transaction in the preset database.
[0093] Optionally, the playback device also includes: a first splitting module, used to split the traffic playback task into multiple sub-tasks before determining the target traffic data generated by the target transaction indicated by the transaction identifier in the playback time period from a preset database, wherein each sub-task carries a set of traffic request identifiers to be obtained; a first allocation module, used to assign each sub-task to a sub-task executor, wherein the sub-task executor obtains, based on the sub-task, the target traffic request corresponding to each traffic request identifier to be obtained in the set of traffic request identifiers to be obtained from the preset database; all the obtained target traffic requests constitute the target traffic data.
[0094] Optionally, the first splitting module includes: a first determination submodule, used to determine the amount of data generated by the target transaction in the playback time period; a first splitting submodule, used to split the traffic playback task based on the data volume, obtain a preset number of traffic requests to be obtained for each subtask, and allocate a preset number of traffic request identifiers to be obtained for each subtask; a first division submodule, used to divide the playback time period into multiple playback time intervals; a second splitting submodule, used to split the traffic playback task based on each playback time interval, and obtain the transaction time of the traffic request to be obtained for each subtask; a first allocation submodule, used to allocate the traffic request identifier to be obtained corresponding to each transaction time to the subtask.
[0095] Optionally, the playback device also includes: a first storage module, which is used to store the acquired target traffic request into a preset delay queue after acquiring the target traffic request corresponding to each traffic request identifier in the set of traffic request identifiers to be acquired from a preset database, and record the storage duration of the target traffic request; a first acquisition module, which is used to acquire the target traffic request from the preset delay queue when the storage duration reaches the preset delay duration.
[0096] Optionally, the playback unit includes: a third determination module, used to determine the current link where the target traffic request obtained from the preset delay queue is located; a first judgment module, used to determine whether all traffic requests corresponding to all links before the current link have been replayed based on the traffic request order; a second judgment module, used to determine whether all traffic requests before the target traffic request on the current link have been replayed based on the traffic request order when all traffic requests corresponding to all links before the current link have been replayed; the first playback module, used to replay the target traffic request when all traffic requests before the target traffic request on the current link have been replayed; a third judgment module, used to determine whether the preset delay queue is an empty queue, and when the preset delay queue is not an empty queue, continue to obtain new target traffic requests with a storage time reaching the preset delay time from the preset delay queue until the preset delay queue is an empty queue, and the playback of the target traffic data is completed.
[0097] The above-mentioned playback device may also include a processor and a memory. The above-mentioned receiving unit 40, determining unit 41, playback unit 42, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0098] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the target traffic data can be replayed based on the traffic request sequence by adjusting the kernel parameters to complete the simulation of the target transaction.
[0099] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (fl ash RAM), and the memory includes at least one storage chip.
[0100] It should be noted that the receiving unit 40, the determining unit 41, and the playback unit 42 correspond to steps S201 to S203 in Embodiment 1, and the examples and application scenarios implemented by the above units and the corresponding steps are the same, but are not limited to the contents disclosed in the above Embodiment 1. It should be noted that the above units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above units can also be run in the computer terminal 10 provided in Embodiment 1 as part of the device.
[0101] Example 3
[0102] An embodiment of the present application may provide an electronic device, Figure 5is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 5 As shown, the electronic device may include: one or more ( Figure 5 (only one is shown) processor 502, memory 504, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0103] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for replaying transaction flows in the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method for replaying transaction flows. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0104] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: receive a traffic playback task, wherein the traffic playback task carries at least: a transaction identifier and a playback time period; determine from a preset database the target traffic data generated by the target transaction indicated by the transaction identifier during the playback time period, wherein the preset database pre-stores the traffic data generated by various transactions in different time periods and the traffic request sequence corresponding to the traffic data of each transaction; based on the traffic request sequence, replay the target traffic data to complete the simulation of the target transaction.
[0105] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: when a recording task is received, the ongoing transaction is recorded to obtain the traffic data of the transaction, wherein the traffic data includes: multiple traffic requests, each traffic request corresponds to traffic request information and a link identifier, and the traffic request information includes at least: transaction time; the traffic data of each recorded transaction is stored in a preset database.
[0106] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: for each transaction, all traffic requests corresponding to the same link identifier are integrated to obtain the message of the link indicated by the link identifier; based on the transaction time, the association order between all traffic requests in each message is determined, and the link execution order between each link is determined; based on the link execution order and the association order of each message, the traffic request order of the transaction is determined; and the traffic request order of each transaction is stored in a preset database.
[0107] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: split the traffic playback task into multiple subtasks, wherein each subtask carries a set of traffic request identifiers to be obtained; assign each subtask to a subtask executor, wherein the subtask executor obtains the target traffic request corresponding to each traffic request identifier to be obtained in the set of traffic request identifiers to be obtained from a preset database based on the subtask; all the obtained target traffic requests constitute the target traffic data.
[0108] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: determine the amount of data generated by the target transaction in the playback time period; based on the data amount, split the traffic playback task to obtain a preset number of traffic requests to be obtained for each subtask, and assign a preset number of traffic request identifiers to be obtained to each subtask; or, divide the playback time period into multiple playback time intervals; based on each playback time interval, split the traffic playback task to obtain the transaction time of the traffic request to be obtained for each subtask; and assign the traffic request identifier to be obtained corresponding to each transaction time to the subtask.
[0109] The processor can also call the information and applications stored in the memory through the transmission device to perform the following steps: storing the obtained target traffic request in a preset delay queue and recording the storage duration of the target traffic request; when the storage duration reaches the preset delay duration, obtaining the target traffic request from the preset delay queue.
[0110] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: determine the current link where the target traffic request obtained from the preset delay queue is located; based on the traffic request order, determine whether all traffic requests corresponding to all links before the current link have been replayed; when all traffic requests corresponding to all links before the current link have been replayed, based on the traffic request order, determine whether all traffic requests before the target traffic request on the current link have been replayed; when all traffic requests before the target traffic request on the current link have been replayed, replay the target traffic request; determine whether the preset delay queue is an empty queue, and when the preset delay queue is not an empty queue, continue to obtain new target traffic requests with a storage time that reaches the preset delay time from the preset delay queue until the preset delay queue is an empty queue, and complete the playback of the target traffic data.
[0111] By adopting the embodiment of the present application, a solution for replaying transaction traffic is provided. By pre-storing the traffic data generated by various transactions in different time periods in a preset database, and pre-determining the traffic request sequence corresponding to the traffic data of each transaction, when receiving a traffic replay task, the target traffic data required by the traffic replay task can be directly obtained from the preset database, and then the target traffic data can be replayed according to the corresponding traffic request sequence, so that a true simulation of the transaction is achieved, the replay success rate and replay processing performance of the business transaction are improved, thereby achieving the technical effect of efficiently replaying the transaction traffic, and then solving the technical problem of the high failure rate of replaying the transaction traffic in the related technology.
[0112] It can be understood by those skilled in the art that Figure 5 The structure shown is for illustration only, and the electronic device may also be a terminal device such as a smart phone, a tablet computer, a PDA, and a Mobile Internet Device (MID). Figure 5 The structure of the electronic device is not limited. Figure 5 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 5 Different configurations shown.
[0113] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0114] Example 4
[0115] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the transaction flow playback method provided in the first embodiment.
[0116] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0117] The present application also provides a computer program product which, when executed on a data processing device, is suitable for executing the program of the method steps for replaying transaction flows.
[0118] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0119] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0120] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0121] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0122] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0123] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or CD-ROM and other media that can store program codes.
[0124] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A transaction flow playback method, characterized in that: include: Receive a traffic playback task, wherein the traffic playback task carries at least: a transaction identifier and a playback time period; Determine from a preset database the target traffic data generated by the target transaction indicated by the transaction identifier during the playback time period, wherein the preset database pre-stores traffic data generated by various transactions during different time periods and a traffic request sequence corresponding to the traffic data of each transaction; Based on the traffic request sequence, the target traffic data is replayed to complete the simulation of the target transaction.
2. The playback method according to claim 1, characterized in that: Before receiving the traffic playback task, it also includes: When receiving a recording task, the ongoing transaction is recorded to obtain the traffic data of the transaction, wherein the traffic data includes: a plurality of traffic requests, each of the traffic requests corresponds to traffic request information and a link identifier, and the traffic request information includes at least: a transaction time; The flow data of each recorded transaction is stored in the preset database.
3. The playback method according to claim 2, characterized in that: After storing the recorded traffic data of each transaction in the preset database, the method further includes: For each transaction, all the traffic requests corresponding to the same link identifier are integrated to obtain a message of the link indicated by the link identifier; Based on the transaction time, determining the association order between all the traffic requests in each of the messages, and determining the link execution order between each of the links; Determining a traffic request order of a transaction based on the link execution order and the association order of each of the messages; The flow request sequence of each transaction is stored in the preset database.
4. The playback method according to claim 1, characterized in that: Before determining the target traffic data generated by the target transaction indicated by the transaction identifier in the playback time period from the preset database, the method further includes: Splitting the traffic playback task into multiple subtasks, wherein each subtask carries a set of traffic request identifiers to be obtained; Each of the subtasks is assigned to a subtask executor, wherein the subtask executor obtains, based on the subtask, from the preset database the target traffic request corresponding to each traffic request identifier to be obtained in the set of traffic request identifiers to be obtained; all the obtained target traffic requests constitute the target traffic data.
5. The playback method according to claim 4, characterized in that: The step of splitting the traffic playback task into multiple subtasks includes: Determining the amount of data generated by the target transaction during the playback time period; Based on the data volume, split the traffic playback task to obtain a preset number of traffic requests to be obtained for each subtask, and allocate the preset number of traffic request identifiers to be obtained to each subtask; or, Dividing the playback time period into a plurality of playback time intervals; Based on each of the playback time intervals, split the traffic playback task to obtain the transaction time of the traffic request to be obtained for each of the subtasks; The to-be-acquired traffic request identifier corresponding to each of the transaction times is assigned to the subtask.
6. The playback method according to claim 4, characterized in that: After obtaining the target traffic request corresponding to each traffic request identifier to be obtained in the set of traffic request identifiers to be obtained from the preset database, the method further includes: The obtained target traffic request is stored in a preset delay queue, and the storage time of the target traffic request is recorded; When the storage duration reaches the preset delay duration, the target traffic request is obtained from the preset delay queue.
7. The playback method according to claim 6, characterized in that: The step of replaying the target traffic data based on the traffic request sequence includes: Determine a current link where the target traffic request obtained from the preset delay queue is located; Based on the traffic request sequence, determining whether all traffic requests corresponding to all links before the current link have been replayed; In the case where all the traffic requests corresponding to all the links before the current link have been replayed, judging whether all the traffic requests before the target traffic request on the current link have been replayed based on the traffic request sequence; When all the traffic requests located before the target traffic request on the current link have been played back, playing back the target traffic request; Determine whether the preset delay queue is an empty queue, and if the preset delay queue is not an empty queue, continue to obtain new target traffic requests whose storage duration reaches the preset delay duration from the preset delay queue, until the preset delay queue is an empty queue, thereby completing the playback of the target traffic data.
8. A transaction flow playback device, characterized in that: include: A receiving unit, configured to receive a traffic replay task, wherein the traffic replay task carries at least: Transaction ID, playback time period; a determination unit, configured to determine, from a preset database, target traffic data generated by the target transaction indicated by the transaction identifier during the playback time period, wherein the preset database pre-stores traffic data generated by various transactions during different time periods and a traffic request sequence corresponding to the traffic data of each transaction; The playback unit is used to play back the target traffic data based on the traffic request sequence to complete the simulation of the target transaction.
9. A computer program product, characterized in that It includes a non-volatile computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, it implements the transaction flow playback method described in any one of claims 1 to 7.
10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the transaction flow playback method described in any one of claims 1 to 7.