Test method, device, equipment, medium and product for traffic playback
Patent Information
- Application Number
- CN202611163500.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-10-30
AI Technical Summary
该方式存在显著局限性:人工用例依赖测试人员经验,难以覆盖生产环境高并发、长尾异常、多参数耦合等真实业务场景,场景覆盖度低,导致测试的准确率较低,并且接口迭代、字段变更后需批量维护测试脚本,人力成本高、更新滞后,导致测试的效率较低
[0010]本发明实施例的技术方案,通过接收到源端服务发送的任意一个源端节点时,基于源端节点的分组标识对源端节点进行存储,基于源端节点的节点类型,确定源端节点是否为源端末尾节点;若是,则将业务请求发送至目标端服务,以使目标端服务执行业务请求,得到多个目标端节点;接收目标端服务发送的多个目标端节点,将多个目标端节点与存储的多个源端节点进行比对,得到测试结果。由此,本申请实施例中可以完整捕获生产环境(源端服务)真实业务流量在全链路各节点的执行轨迹与状态,并在目标测试环境(目标端服务)中实现精准回放与深度对比来实现测试,并不需要人工手动来编写测试用例,提高了测试的效率和准确性。
Smart Images

Figure CN123020429A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to testing methods, apparatus, equipment, media, and products for traffic playback. Background Technology
[0002] With the large-scale deployment of cloud-native and microservice distributed architectures, business systems are broken down into dozens to hundreds of independently deployed microservice nodes. A single user request needs to cross gateways, RPC services, message middleware, caches, and databases to form a multi-level mesh call chain. At the same time, the version update frequency has increased significantly under agile iteration and continuous release models, which places extremely high demands on pre-deployment regression verification, performance baseline verification, and online reproduction of occasional failures.
[0003] Traditional automated testing solutions primarily rely on manually writing interface test cases and unit test scripts for verification. This approach has significant limitations: manual test cases depend on the testers' experience and are difficult to cover real-world business scenarios such as high concurrency, long-tail anomalies, and multi-parameter coupling in production environments. This low scenario coverage leads to low test accuracy. Furthermore, after interface iterations and field changes, test scripts need to be maintained in batches, resulting in high labor costs, delayed updates, and low testing efficiency. Summary of the Invention
[0004] This invention provides a method, apparatus, device, medium, and product for testing traffic playback, which improves the testing efficiency and accuracy of traffic playback.
[0005] According to a first aspect of the present invention, a method for testing traffic replay is provided, the method comprising: When any source node is received from the source service, the source node is stored based on its group identifier, wherein the source node is obtained after the source service executes the corresponding business request; Based on the node type of the source node, determine whether the source node is the end node of the source. If so, the service request is sent to the target service so that the target service executes the service request and obtains multiple target nodes; The system receives the multiple target endpoints sent by the target endpoint service, compares the multiple target endpoints with the multiple stored source endpoints, and obtains the test results.
[0006] According to another aspect of the present invention, a test apparatus for traffic playback is provided, the apparatus comprising: The receiving module is used to store the source node based on the group identifier of the source node when it receives any source node sent by the source service, wherein the source node is obtained after the source service executes the corresponding business request; The determination module is used to determine whether the source node is the end node of the source based on the node type of the source node. The sending module is configured to, if so, send the service request to the target service so that the target service executes the service request and obtains multiple target nodes; The comparison module is used to receive the multiple target end nodes sent by the target end service, compare the multiple target end nodes with the multiple stored source end nodes, and obtain the test results.
[0007] According to another aspect of the present invention, an electronic device is provided, the electronic device including at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the traffic playback test method described in the first aspect.
[0008] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the test method for traffic replay as described in any embodiment of the present invention.
[0009] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of the test method for traffic replay as described in any embodiment of the present invention.
[0010] The technical solution of this invention, upon receiving any source node sent by the source service, stores the source node based on its group identifier and determines whether it is the last node of the source service based on its node type. If so, the business request is sent to the target service to execute the request, resulting in multiple target nodes. The multiple target nodes sent by the target service are then compared with the stored source nodes to obtain the test results. Therefore, this embodiment can completely capture the execution trajectory and status of real business traffic in the production environment (source service) across all nodes in the entire chain, and achieve accurate replay and in-depth comparison in the target test environment (target service) to perform testing, eliminating the need for manual test case writing and improving testing efficiency and accuracy.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present invention; Figure 2 This is a system structure diagram provided according to an embodiment of the present invention; Figure 3 This is a flowchart of a traffic replay test method provided according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the process for determining test results according to an embodiment of the present invention; Figure 5 This is a flowchart illustrating the test method for traffic replay provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of a test device for traffic playback according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present invention. Detailed Implementation
[0014] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0015] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0016] Current automated testing solutions mainly rely on manually writing interface test cases and unit test scripts for verification. This approach has significant limitations: manual test cases depend on the experience of testers and are difficult to cover real business scenarios such as high concurrency, long-tail anomalies, and multi-parameter coupling in production environments. The low scenario coverage leads to low test accuracy. Furthermore, after interface iterations and field changes, test scripts need to be maintained in batches, resulting in high labor costs and delayed updates, thus reducing testing efficiency.
[0017] In view of this, this application provides a traffic replay testing method. Upon receiving any source node from a source service, the method stores the source node based on its group identifier and determines whether it is the last node of the source service based on its node type. If so, the method sends a business request to a target service to execute the request, resulting in multiple target nodes. The method then receives these multiple target nodes from the target service and compares them with the stored source nodes to obtain the test results. Therefore, this application embodiment can completely capture the execution trajectory and status of real business traffic in the production environment (source service) across all nodes in the entire link, and achieve accurate replay and in-depth comparison in the target test environment (target service) to realize testing. This eliminates the need for manual test case writing, improving testing efficiency and accuracy.
[0018] Before introducing the test method for traffic replay provided in the embodiments of this application, the technical background of the embodiments of this application will be described in detail below for ease of understanding.
[0019] Before introducing the test method for traffic replay in this application, we will first introduce the application scenarios corresponding to the test method for traffic replay in this application. Figure 1 This is a diagram illustrating the application scenario, from Figure 1As can be seen from the above, this application scenario includes server 110 and terminal device 120. In this embodiment, server 110 can be implemented as a physical server or as a virtual server.
[0020] In one possible embodiment, when server 110 receives any source node sent by source service, it stores the source node based on the group identifier of the source node, wherein the source node is obtained after the source service executes the corresponding business request; based on the node type of the source node, it determines whether the source node is the end node of the source; if so, it sends the business request to the target service so that the target service executes the business request to obtain multiple target nodes; it receives the multiple target nodes sent by the target service, compares the multiple target nodes with the stored multiple source nodes to obtain a test result, and sends the test result to terminal device 120 for display.
[0021] in, Figure 1 The server 110 and the terminal device 120 can exchange information via a communication network. The communication network can use either wireless or wired communication.
[0022] For example, server 110 can access the network via cellular mobile communication technology and communicate with terminal device 120, wherein the cellular mobile communication technology includes, for example, 5th generation mobile networks (5G) technology.
[0023] Optionally, server 110 can access the network and communicate with terminal device 120 via short-range wireless communication, wherein the short-range wireless communication method includes, for example, Wireless Fidelity (Wi-Fi) technology.
[0024] Furthermore, the description in this application details only a single server 110 and a single terminal device 120. However, those skilled in the art should understand that the illustrated server 110 and terminal device 120 are intended to show that the technical solution of this application involves the operation of server 110 and terminal device 120, and not to imply any limitation on the number, type, or location of server 110 and terminal device 120. It should be noted that adding additional modules to or removing individual modules from the illustrated environment will not change the underlying concept of the exemplary embodiments of this application.
[0025] For example, terminal device 120 includes, but is not limited to: large visual screens, tablet computers, laptops, handheld computers, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminal devices in industrial control, wireless terminal devices in autonomous driving, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, or wireless terminal devices in smart homes, etc.; the terminal device may have a related client installed, which may be software (e.g., browsers, short video software, etc.), or web pages, mini-programs, etc.
[0026] The system architecture for testing traffic replay in this embodiment of the application is described below. Figure 2 For the system architecture diagram, from Figure 2 As can be seen, the architecture includes source service 201, target service 202, traffic interception component 203, traffic collection and comparison service 204, source business gateway 205, and target business gateway 206. Among them: A service request is sent to the source service 201 via the source service gateway 205. After executing the service request, the source service 201 obtains each source node and sends the source nodes to the traffic collection and comparison service 204. When the traffic collection and comparison service 204 receives any source node sent by the source service 201, it stores the source node based on the group identifier of the source node. Then, based on the node type of the source node, it determines whether the source node is the last node of the source. If so, it sends the service request to the target service 202 so that the target service 202 executes the service request and obtains multiple target nodes. The target service 202 receives the multiple target nodes sent by the target service 202 and compares the multiple target nodes with the stored multiple source nodes to obtain the test result.
[0027] The traffic interception component in this application embodiment includes an interceptor module, an aspect enhancement module, and a third-party slow-down module. Wherein: (1) The interceptor module obtains partial information of the request (REQ) node and completes the initialization of partial node information through a predefined preprocessing method. When the service initiates a remote call, the interceptor increments the node sequence number by 1 and passes key information such as the node sequence number and group identifier to subsequent links. When the service interacts with the database, the interceptor module captures the executed SQL statement through the SQL interceptor of the persistence layer mapping framework and converts its parameterized format into complete executable SQL (including actual parameter values).
[0028] (2) The aspect enhancement module is based on aspect-oriented programming technology and implements pre- and post-enhancement enhancements on the controller layer without intruding on the original service code. On the one hand, this module can obtain more detailed information about request and response nodes, such as interface names and message content; on the other hand, rate limiting strategies can be embedded here to achieve fine-grained control of inbound traffic through user or service-level traffic control.
[0029] (3) The third-party tracking module is responsible for recording relevant information of the third-party nodes when this service interacts with external third-party applications, including third-party identifiers, third-party URLs, etc., and incrementing the node sequence number by 1.
[0030] The following describes a test method for traffic replay in an exemplary embodiment of this application, in conjunction with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the methods and principles of this application, and the implementation of this application is not limited in any way in this respect.
[0031] Combination Figure 1 In the application scenarios described below, the test method for traffic replay in the embodiments of this application will be introduced in detail. Figure 3 A flowchart of a traffic replay test method provided in an embodiment of the present invention, from... Figure 3 As can be seen from this, it may specifically include the following steps: S310: When receiving any source node sent by the source service, store the source node based on the group identifier of the source node, wherein the source node is obtained after the source service executes the corresponding business request; In the embodiments of this application, any node (source node or target node) includes a group identifier, service type, service name, node type, node sequence number, SQL sequence number, interface name, node content, third-party identifier, third-party URL, request header, insertion time, and update time, etc.
[0032] The group identifier is a unique 32-bit string used to identify all nodes within the link and distinguish it from other links; therefore, all nodes within the same link have the same group identifier. The service name is the name corresponding to the source or destination service. The service type distinguishes whether the traffic belongs to the source or destination service; for example, it can be identified by 0 and 1 respectively. The node type indicates whether the node is a request (REQ), response (RSP), or SQL node. The node sequence number and SQL sequence number reflect the execution order of various operations in the traffic link. To avoid the service node sequence number stored in the local thread being overwritten by third-party nodes, this embodiment separates the third-party node sequence number from the service node sequence number variable, obtaining the corresponding sequence number based on the call type. The node content stores the request / response message or an executable SQL statement with parameters. The third-party identifier and third-party URL record information about external systems interacting with this service.
[0033] In this embodiment, multiple topics are used as nodes for collection, with each topic having up to 48 queues. Load balancing is implemented during distribution. Furthermore, to ensure that multiple traffic links triggered by the same user's operation maintain order during consumption and to avoid replay anomalies due to out-of-order delivery, this embodiment uses the user code as the topic partition key, guaranteeing that different link messages from the same user are sent sequentially to the same queue.
[0034] Furthermore, since the consumers collecting topics adopt a sequential consumption mode, each consumer pulls only one message at a time, processes it, and then pulls the next message. To improve consumption throughput, the number of consumers and the number of queues are maintained in a 1:1 ratio.
[0035] In this embodiment, the larger body field content (containing request / response messages, SQL statements, etc.) is stored on the server disk, while only the corresponding file path is retained in the database. Furthermore, this embodiment uses a scheduled task to periodically clean up the body files stored on the disk, with a default retention period of seven days, ensuring effective utilization of storage resources.
[0036] In one possible implementation, S310 can be specifically implemented as follows: performing a hash modulo operation on the group identifier to obtain a storage identifier; and storing the source node information into the corresponding storage space based on the storage identifier.
[0037] S320: Based on the node type of the source node, determine whether the source node is the end node of the source; In this embodiment, the service request can only be sent to the target service after the source end node is stored.
[0038] S330: If so, the service request is sent to the target service so that the target service executes the service request and obtains multiple target nodes; S340: Receive the multiple target endpoints sent by the target endpoint service, compare the multiple target endpoints with the multiple stored source endpoints, and obtain the test results.
[0039] The method for determining test results in the embodiments of this application will be described below. Figure 4 A flowchart for determining test results may include the following steps: S410: Using node sequence numbers, group the plurality of target end nodes and the plurality of source end nodes to obtain a plurality of node sets, wherein any node set includes a source end node and a target end node, and the node sequence numbers of the remote end node and the target end node in the node set are the same. S420: For any set of nodes, compare the source node and the target node in the set of nodes to determine whether the source node and the target node are the same. If yes, execute S430; otherwise, execute S440. S430: The test result is confirmed as successful; In one possible implementation, after S430, the plurality of source nodes are deleted.
[0040] S440: The test result is determined to be a failure.
[0041] In this embodiment of the application, if the test result is determined to be a failure, all nodes in the link are retained for manual analysis of differences.
[0042] In this embodiment, the target service provides a third-party response interface shield to prevent a surge in access pressure on the third-party system caused by the target service making numerous calls to the third-party interface during the replay of massive traffic from the source end. The traffic collection and comparison service records and stores the request results of the target service calling the third-party system. When the third-party tracking module in the interception component identifies that the target service is requesting the third party, it redirects the call to the collection and comparison service interface to obtain the third-party response result.
[0043] To further understand one of the traffic replay testing methods in this application, Figure 5 The flowchart for the traffic replay testing method can be summarized as follows: S510: When receiving any source node sent by the source service, store the source node based on the group identifier of the source node, wherein the source node is obtained after the source service executes the corresponding business request; S520: Based on the node type of the source node, determine whether the source node is the last node of the source; S530: If so, the service request is sent to the target service so that the target service executes the service request and obtains multiple target nodes; S540: Receive the plurality of target endpoints sent by the target endpoint service; S550: Using node sequence numbers, group the multiple target end nodes and the multiple source end nodes to obtain multiple node sets, wherein any node set includes a source end node and a target end node, and the node sequence numbers of the remote end node and the target end node in the node set are the same. S560: For any set of nodes, compare the source node and the target node in the set to determine whether the source node and the target node are the same. If yes, proceed to S570; otherwise, proceed to S580. S570: The test result is confirmed as successful; S580: The test result is determined to be a failure.
[0044] Based on the same inventive concept, this application also provides a test device for traffic playback. Figure 6 This is a schematic diagram of the test device for this flow playback. Figure 6 As shown, the device 600 includes: The receiving module 610 is used to store the source node based on the group identifier of the source node when it receives any source node sent by the source service, wherein the source node is obtained after the source service executes the corresponding business request; The judgment module 620 is used to determine whether the source node is the end node of the source based on the node type of the source node; The sending module 630 is configured to send the service request to the target service if the condition is met, so that the target service executes the service request and obtains multiple target nodes. The comparison module 640 is used to receive the multiple target end nodes sent by the target end service, compare the multiple target end nodes with the multiple stored source end nodes, and obtain test results.
[0045] In one possible embodiment, the receiving module 610 is specifically used for: Perform a hash modulo operation on the group identifier to obtain the storage identifier; The source node information is stored in the corresponding storage space based on the storage identifier.
[0046] In one possible embodiment, the comparison module 640 is specifically used for: Using node numbers, the multiple target end nodes and the multiple source end nodes are grouped to obtain multiple node sets. Each node set includes one source end node and one target end node, and the node numbers of the remote end node and the target end node in the node set are the same. For any set of nodes, the source node and the target node in the set of nodes are compared to determine whether the source node and the target node are the same. If so, then the test result is considered successful; If not, the test result is determined to be a failure.
[0047] In one possible embodiment, the device further includes: The deletion module 650 is used to delete the multiple source nodes after determining that the test result is successful.
[0048] In one possible embodiment, the source node is obtained from the source service through a traffic interception component, and the target node is obtained from the target service through the traffic interception component.
[0049] The traffic playback test device provided in this embodiment of the invention can execute the traffic playback test method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0050] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0051] The information collected is information and data authorized by the user or fully authorized by all parties. The collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant countries and regions, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding operation portals are provided for users to choose to authorize or refuse.
[0052] Provide users with corresponding operation entry points, allowing them to choose to agree to or reject the automated decision results; if the user chooses to reject, the process will proceed to the expert decision-making process.
[0053] Figure 7A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0054] like Figure 7 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0055] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0056] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the test method for traffic replay.
[0057] In some embodiments, the traffic replay testing method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed on an electronic device via ROM and / or a communication unit. When the computer program is loaded into RAM and executed by a processor, one or more steps of the traffic replay testing method can be performed. Alternatively, in other embodiments, the processor can be configured to perform the traffic replay testing method by any other suitable means (e.g., by means of firmware).
[0058] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0059] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0060] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0061] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0062] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0063] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0064] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0065] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A test method for traffic replay, characterized in that, The method includes: When any source node is received from the source service, the source node is stored based on its group identifier, wherein the source node is obtained after the source service executes the corresponding business request; Based on the node type of the source node, determine whether the source node is the end node of the source. If so, the service request is sent to the target service so that the target service executes the service request and obtains multiple target nodes; The system receives the multiple target endpoints sent by the target endpoint service, compares the multiple target endpoints with the multiple stored source endpoints, and obtains the test results.
2. The method according to claim 1, characterized in that, The storage of the source node based on the group identifier of the source node includes: Perform a hash modulo operation on the group identifier to obtain the storage identifier; The source node information is stored in the corresponding storage space based on the storage identifier.
3. The method according to claim 1, characterized in that, The step of comparing the multiple target endpoints with the multiple stored source endpoints to obtain test results includes: Using node numbers, the multiple target end nodes and the multiple source end nodes are grouped to obtain multiple node sets. Each node set includes one source end node and one target end node, and the node numbers of the remote end node and the target end node in the node set are the same. For any set of nodes, the source node and the target node in the set of nodes are compared to determine whether the source node and the target node are the same. If so, then the test result is considered successful; If not, the test result is determined to be a failure.
4. The method according to claim 3, characterized in that, After determining that the test result is successful, the method further includes: Delete the multiple source nodes.
5. The method according to claim 1, characterized in that, The source node is obtained from the source service through the traffic interception component, and the target node is obtained from the target service through the traffic interception component.
6. A test device for flow playback, characterized in that, The device includes: The receiving module is used to store the source node based on the group identifier of the source node when it receives any source node sent by the source service, wherein the source node is obtained after the source service executes the corresponding business request; The determination module is used to determine whether the source node is the end node of the source based on the node type of the source node. The sending module is configured to send the service request to the target service if the condition is met, so that the target service executes the service request and obtains multiple target nodes. The comparison module is used to receive the multiple target end nodes sent by the target end service, compare the multiple target end nodes with the multiple stored source end nodes, and obtain the test results.
7. The apparatus according to claim 6, characterized in that, The receiving module is specifically used for: Perform a hash modulo operation on the group identifier to obtain the storage identifier; The source node information is stored in the corresponding storage space based on the storage identifier.
8. An electronic device, characterized in that, The electronic device includes at least one processor; and a memory communicatively connected to the at least one processor; wherein... The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the test method for traffic replay according to any one of claims 1-5.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the test method for traffic replay according to any one of claims 1-5.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the test method for traffic replay according to any one of claims 1-5.
