A mirror testing method and apparatus

By mirroring the production environment server as the test environment server and delaying response messages to simulate the production process, the problem that the test environment cannot accurately simulate actual production is solved, and the accuracy and efficiency of locating production problems are improved.

CN116743553BActive Publication Date: 2026-05-26HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
Filing Date
2023-06-09
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

In existing technologies, the testing environment cannot fully simulate actual production conditions, resulting in low accuracy and efficiency in locating production problems and reduced production efficiency.

Method used

By mirroring the abnormal production environment server as a test environment server, the production environment workflow is simulated, and the abnormal production environment is restored by delaying response messages, thereby improving the accuracy and efficiency of locating production problems.

Benefits of technology

By using mirror testing methods, production problems can be accurately located, production efficiency can be improved, and the accuracy of production environment simulation and problem-solving efficiency can be enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116743553B_ABST
    Figure CN116743553B_ABST
Patent Text Reader

Abstract

This application provides a mirror testing method and apparatus for a traffic replay platform, applicable to the field of data processing technology. It involves acquiring a test request, including a test identifier, sent by a test environment server (a mirror server of an abnormal production environment server); determining a response message based on the test identifier, the response message including a response duration; and delaying the transmission of the response message to the test environment server based on the response duration. The response message indicates the mirror test result. In this way, the abnormal production environment server is mirrored as the test environment server, simulating the production workflow, and the response message is sent to the test environment server with a delay according to the response duration. Recreating a faulty production environment and delaying the response based on the actual situation helps to accurately locate faults, improving the accuracy and efficiency of locating production problems, and further improving production efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, specifically to a mirror testing method and apparatus. Background Technology

[0002] In daily production operations, it is necessary to optimize for failures that occur during the production process. Currently, this is typically done by anonymizing production transaction information to generate test data, and then replaying the transactions in a test environment based on the test scenario to output transaction return information.

[0003] The current approach fails to fully simulate actual production conditions in terms of testing environment and process, resulting in low accuracy and efficiency in locating production problems and significantly reduced production efficiency. Summary of the Invention

[0004] In view of this, this application provides a mirror testing method and apparatus, which mirrors an abnormal production environment server as a test environment server, simulates the production environment workflow, improves the accuracy and efficiency of locating production problems, and further enhances production efficiency.

[0005] To solve the above problems, the technical solution provided in this application is as follows:

[0006] Firstly, this application provides a mirror testing method, which is applied to a traffic replay platform and includes:

[0007] Obtain a test request sent by a test environment server, wherein the test environment server is a mirror server of an abnormal production environment server, and the test request includes a test identifier;

[0008] The response message is determined based on the test identifier, and the response message includes the response duration.

[0009] Based on the response duration, the response message is delayed before being sent to the test environment server. The response message is used to indicate the image test results.

[0010] In one possible implementation, the method further includes:

[0011] Obtain configuration information and production traffic frequency. The configuration information includes the IP address of the abnormal production environment server, the target traffic time period, and the start time of traffic replay.

[0012] The traffic to be tested is determined based on the IP address of the abnormal production environment server and the target traffic time period.

[0013] Based on the production traffic frequency and the start time of the traffic replay, the traffic to be tested is scheduled to the test environment server.

[0014] In one possible implementation, the response message further includes a response identifier, and the method further includes:

[0015] The response set is determined in advance based on the configuration information;

[0016] The step of determining the response message based on the test identifier includes:

[0017] The response message corresponding to the traffic to be tested is determined from the response set based on the test identifier and the response identifier.

[0018] In one possible implementation, the test environment server is configured with a sidecar mode service, and the step of obtaining the test request sent by the test environment server includes:

[0019] Obtain the test request sent by the sidecar mode service according to the preset configured traffic forwarding rules;

[0020] The configured traffic forwarding rules include the IP address of the original database, the IP address of the traffic pool corresponding to the original database, and the connection port.

[0021] In one possible implementation, the method further includes:

[0022] Obtain the error rate of the target business metrics for the production environment server;

[0023] If the error rate of the target business indicator meets the preset conditions, then the production environment server is determined to be an abnormal production environment server.

[0024] Secondly, this application provides a mirror testing device, which is applied to a traffic replay platform and includes:

[0025] The acquisition module is used to acquire test requests sent by the test environment server, wherein the test environment server is a mirror server of the abnormal production environment server, and the test request includes a test identifier;

[0026] A determination module is used to determine a response message based on the test identifier, wherein the response message includes a response duration;

[0027] The delayed sending module is used to delay sending the response message to the test environment server based on the response duration, and the response message is used to indicate the mirror test result.

[0028] In one possible implementation, the device further includes a scheduling module:

[0029] The acquisition module is also used to acquire configuration information and production traffic frequency. The configuration information includes the IP address of the abnormal production environment server, the target traffic time period, and the start time of traffic replay.

[0030] The determining module is further configured to determine the traffic to be tested based on the IP address of the abnormal production environment server and the target traffic time period;

[0031] The scheduling module is used to schedule the traffic to be tested to the test environment server according to the production traffic frequency and the start time of the traffic playback.

[0032] In one possible implementation, the response message further includes a response identifier, and the determining module is further configured to pre-determine a set of responses based on the configuration information;

[0033] The determining module is used to determine the response message based on the test identifier, including:

[0034] The determination submodule is used to determine the response message corresponding to the traffic to be tested from the response set based on the test identifier and the response identifier.

[0035] In one possible implementation, the test environment server is configured with a sidecar mode service, and the acquisition module is used to acquire test requests sent by the test environment server, including:

[0036] The acquisition submodule is used to acquire test requests sent by the sidecar mode service according to preset configuration traffic forwarding rules; the configuration traffic forwarding rules include the IP address of the original database, the IP address of the traffic pool corresponding to the original database, and the connection port.

[0037] In one possible implementation, the acquisition module is further configured to acquire the target business metric error rate of the production environment server;

[0038] The determining module is further configured to determine that if the error rate of the target business indicator meets a preset condition, then the production environment server is determined to be an abnormal production environment server.

[0039] Thirdly, this application provides a mirror testing device, including: a processor, a memory, and a system bus;

[0040] The processor and the memory are connected via the system bus;

[0041] The memory is used to store one or more programs, the one or more programs including instructions that, when executed by the processor, cause the processor to perform the mirror testing method described in the first aspect above.

[0042] Fourthly, this application provides a computer-readable storage medium that stores instructions that, when executed on a device, cause the device to perform the image testing method described in the first aspect.

[0043] Therefore, this application has the following beneficial effects:

[0044] This application provides a mirror testing method and apparatus applied to a traffic replay platform. First, a test request is obtained from a test environment server, which is a mirror server of an abnormal production environment server. The test request includes a test identifier. Second, a response message is determined based on the test identifier, and the response message includes a response duration. Finally, based on the response duration, the response message is sent to the test environment server with a delay. The response message indicates the mirror test result. In this way, the abnormal production environment server is mirrored as a test environment server, simulating the production workflow, and the response message is sent to the test environment server with a delay according to the response duration. Recreating the faulty abnormal production environment and delaying the response according to the actual situation helps to accurately locate the fault, improving the accuracy and efficiency of locating production problems, and further improving production efficiency. Attached Figure Description

[0045] Figure 1 An application architecture diagram of a mirror testing method provided in this application embodiment;

[0046] Figure 2 A schematic flowchart of a mirror testing method provided in an embodiment of this application;

[0047] Figure 3 A schematic diagram of the architecture of a request scheduler provided in an embodiment of this application;

[0048] Figure 4 A schematic diagram of the architecture of a sidecar provided in an embodiment of this application;

[0049] Figure 5 This application provides a schematic diagram of the architecture of a response scheduler.

[0050] Figure 6 A schematic diagram of a traffic pool architecture provided for an embodiment of this application;

[0051] Figure 7 This is a schematic diagram of the structure of a mirror testing device provided in an embodiment of this application;

[0052] Figure 8 This is a schematic diagram of the structure of a mirror testing device provided in an embodiment of this application. Detailed Implementation

[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0054] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0055] The inventors discovered that current methods typically involve anonymizing production and transaction information to generate test data. This test data is then used to replay transactions within a test environment, based on test scenarios, to output transaction return information. These test scenarios include switch-on testing, functional testing, and performance testing.

[0056] In current processing methods, traffic replay may not be based on the production environment or the actual production traffic frequency for application diagnosis. In other words, the test environment and test process cannot reproduce the actual production state (e.g., CPU utilization, memory utilization, thread state, etc.). Therefore, the accuracy and efficiency of locating production problems are low, and production efficiency is greatly reduced.

[0057] This application provides a mirror testing method and apparatus applied to a traffic replay platform. A test environment server is constructed using an abnormal production environment server as a baseline, restoring the infrastructure of the abnormal production environment; that is, the test environment server is a mirror server of the abnormal production environment server. First, a test request sent by the test environment server is obtained, including a test identifier. Second, a response message is determined based on the test identifier, including a response duration. Finally, based on the response duration, the response message is sent to the test environment server with a delay. The response message indicates the mirror test result. By mirroring the abnormal production environment server as a test environment server, the faulty abnormal production environment is restored. The production workflow is simulated according to the actual situation, for example, by delaying the sending of response messages to the test environment server according to the response duration. This helps to accurately locate faults, improving the accuracy and efficiency of locating production problems, and further improving production efficiency.

[0058] Specifically, DevOps (a combination of Development and Operations) techniques can be used to automatically deploy a test environment server with the same specifications and image as the production environment server, serving as a baseline. Using the production environment as a template, a new service environment, i.e., the test environment, is created, including information such as server model and specifications, image, network, and storage. DevOps is an overall term for development and operations maintenance, used to coordinate collaboration between development and operations departments, automating the use of cloud computing infrastructure to complete actual testing and code deployment, accelerating the frequency of delivery and deployment. DevOps implementation technologies include CI (Continuous Integration) and CD (Continuous Delivery and Deployment).

[0059] To facilitate understanding of the technical solutions provided in the embodiments of this application, the following description, in conjunction with the accompanying drawings, illustrates a mirror testing method and apparatus provided in the embodiments of this application.

[0060] See Figure 1 , Figure 1 This application provides an application architecture diagram for a mirror testing method, including an abnormal production environment server, a test environment server, and a traffic replay platform. The test environment server is generated by mirroring the abnormal production environment server. The test environment server and the traffic replay platform work together to simulate an abnormal production process. Actual production traffic is collected and mirrored to a traffic pool in the traffic replay platform, facilitating traffic retrieval from the pool. Based on the production traffic frequency, requests are made to the test environment, and the traffic is sent to the test environment server. Response messages are then returned according to the actual production time. This recreates the actual request situation of the abnormal production environment, highly replicating the abnormal production environment and its corresponding production state, thereby improving the accuracy and efficiency of R&D personnel in locating production problems.

[0061] This application provides a mirror testing method applied to a traffic replay platform, which consists of a request scheduler, a traffic pool, and a response scheduler. See also... Figure 2 , Figure 2 This is a flowchart illustrating a mirror testing method provided in an embodiment of this application. The method specifically includes steps S201-S203.

[0062] S201: Obtain a test request sent by the test environment server, wherein the test environment server is a mirror server of the abnormal production environment server, and the test request includes a test identifier.

[0063] This application uses an abnormal production environment as an example for illustration, and redeploys a test environment based on the abnormal production environment through automated deployment. Alternatively, a normal production environment can be mirrored to simulate the normal production environment and optimize relevant data in subsequent production environments to improve production efficiency; this application is not limited to this approach.

[0064] Before the traffic replay system receives test requests from the test environment server, it also needs to send a scheduling request to the test environment service system via the request scheduler. (See also...) Figure 3 , Figure 3 This is a schematic diagram of the architecture of a request scheduler provided in an embodiment of this application. The request scheduler is divided into a configuration center and a request queue. The configuration center is configured manually. In addition to the IP address (request IP) of the abnormal production environment server, the target traffic time range, and the start time of traffic replay, the configuration information also includes the IP address (target IP) of the test environment server.

[0065] The request queue is determined based on the IP address (request IP) of the abnormal production environment server in the configuration center and the target traffic time range. In other words, the request scheduler selects test traffic that meets the criteria from the traffic pool and places it into the request queue. Traffic replay begins at the start time, and the test traffic is sent to the test environment server for testing according to the interval order of production traffic (production traffic frequency). The frequency of traffic transmission is consistent with the production traffic frequency, which more closely replicates the workflow of the abnormal production environment. This provides developers with a test environment that is closest to the production environment, enabling them to locate complex production issues, improve problem localization efficiency, and reduce problem-solving costs.

[0066] In one possible implementation, the method may further include: obtaining configuration information and production traffic frequency, wherein the configuration information includes the IP address (request IP) of the abnormal production environment server, the target traffic time range, and the traffic replay start time; determining the traffic to be tested based on the IP address of the abnormal production environment server and the target traffic time range; and scheduling the traffic to be tested to the test environment server based on the production traffic frequency and the traffic replay start time.

[0067] Before performing mirror testing, a sidecar service, i.e., a network proxy sidecar, can be pre-implanted. See also Figure 4 , Figure 4 This is a schematic diagram of a sidecar architecture provided in an embodiment of this application. The sidecar mode service can be considered as a slave container, running alongside the test service container. The sidecar mentioned in this embodiment is a network traffic management service that runs alongside the test service container in slave container mode. It does not require intrusion into the source code or modification of any configuration information of the production service. The sidecar is compatible with cloud-native systems, shields technical language differences, and can intercept traffic output from the test environment server, achieving functions such as traffic interception, copying, and forwarding.

[0068] In one possible implementation, the test environment server is configured with a sidecar mode service, and obtaining the test request sent by the test environment server includes: obtaining the test request sent by the sidecar mode service according to a preset configured traffic forwarding rule; the configured traffic forwarding rule includes the IP address of the original database, the IP address of the traffic pool corresponding to the original database, and the connection port.

[0069] Upon receiving a scheduling request and its associated request queue, the test environment server can generate and send test requests to downstream services or components. When a test request is sent to a downstream service or component, the network proxy sidecar intercepts the request and forwards it to the response scheduler of the traffic replay system according to pre-configured traffic forwarding rules. The traffic replay system then simulates downstream services, thereby obtaining actual production traffic. The traffic forwarding rules are configured in the sidecar service via a configuration file, which is loaded when the sidecar starts. For example, when operating a database, the configuration rules could include: the original database's IP address, the connection port, and the forwarding target (the traffic pool's IP address). The sidecar will intercept traffic on the listening connection port and forward it to the target server.

[0070] S202: Determine the response message based on the test identifier, the response message including the response duration.

[0071] The response scheduler in the traffic replay system matches the response message with the received test request and delays the response to the test environment server according to the original response traffic duration.

[0072] See Figure 5 , Figure 5 This is a schematic diagram of the architecture of a response scheduler provided in an embodiment of this application. After a test request is forwarded to the response scheduler, the response scheduler obtains the response message based on the test identifier ID and returns it to the test environment server after a delay according to the actual time consumed by the response message, that is, the response message is returned to the test environment server according to the response duration.

[0073] In one possible implementation, the test request includes a test identifier, and the response message also includes a response identifier. The method further includes: pre-determining a response set based on the configuration information; determining the response message based on the test identifier includes: determining the response message corresponding to the traffic to be tested from the response set based on the test identifier and the response identifier.

[0074] A response set is pre-determined from the traffic pool based on configuration information, and stored in a map set using the test identifier ID as the key. This response set includes all response packets from servers in the abnormal production environment. When a test request is received, the response packet corresponding to the traffic to be tested is determined from the response set according to the mapping between the test identifier and the response identifier.

[0075] See Figure 6 , Figure 6 This is a schematic diagram of a traffic pool architecture provided in an embodiment of this application. The traffic in the traffic pool consists of packets backed up from a server in an abnormal production environment, including test request packets and response packets. The test request packet includes the IP address of the server that generated the test request, the test time, and a unique test identifier ID. The response packet includes the response time, a unique response identifier ID, and the response duration.

[0076] S203: Based on the response duration, delay sending the response message to the test environment server, the response message being used to indicate the image test results.

[0077] To better replicate the workflow of an abnormal production environment, responses are delayed and sent to the test environment server based on response duration. The response message mirrors the test results; based on this response message, the process causing the production problem can be quickly identified, improving the accuracy and efficiency of identifying production issues.

[0078] In one possible implementation, this application embodiment uses an abnormal production environment server as an example for illustration. The method further includes determining whether the production environment is abnormal. Specifically, this can be done by: obtaining the target business indicator error rate of the production environment server; and determining that the target business indicator error rate meets a preset condition, then determining that the production environment server is an abnormal production environment server. This preset condition can be that the target business indicator error rate is greater than a preset threshold, and the preset threshold can be set according to actual conditions. The above is merely an example; it can also be determined based on the memory usage rate after the service has been running for a period of time, but this application embodiment does not limit this approach.

[0079] Based on the above S201-S203, the test environment server is a mirror server of the abnormal production environment server. It receives test requests from the test environment server, including a test identifier, and then determines the response message based on this identifier. The response message includes a response duration. Based on the response duration, the response message is delayed before being sent to the test environment server. This response message indicates the mirror test result. In this way, the abnormal production environment server is mirrored as the test environment server, simulating the production workflow, and the response message is sent to the test environment server with a delay according to the response duration. Recreating the faulty abnormal production environment and delaying the response based on the actual situation helps to accurately locate the fault, improving the accuracy and efficiency of locating production problems, and further improving production efficiency.

[0080] The image testing method and apparatus provided in this application can be applied to the fields of data processing technology, cloud computing, DevOps, or testing. The above are merely examples and do not limit the application areas of the image testing method and apparatus provided in this application.

[0081] The foregoing embodiments of this application provide a mirror testing method based on the above description. Next, we will describe a mirror testing apparatus also provided in this application embodiment. This apparatus is applied to a traffic replay platform and performs the aforementioned... Figure 2 The method shown below will be followed by a description of the function of the mirror testing device, the structural schematic diagram of which is shown in the figure below. Figure 7 As shown, it includes an acquisition module 701, a determination module 702, and a delayed transmission module 703.

[0082] The acquisition module 701 is used to acquire a test request sent by the test environment server, wherein the test environment server is a mirror server of the abnormal production environment server, and the test request includes a test identifier.

[0083] The determination module 702 is used to determine a response message based on the test identifier, wherein the response message includes a response duration.

[0084] The delayed sending module 703 is used to delay sending the response message to the test environment server based on the response duration, and the response message is used to indicate the mirror test result.

[0085] In one possible implementation, the device further includes a scheduling module:

[0086] The acquisition module 701 is also used to acquire configuration information and production traffic frequency. The configuration information includes the IP address of the abnormal production environment server, the target traffic time period, and the start time of traffic replay.

[0087] The determining module 702 is further configured to determine the traffic to be tested based on the IP address of the abnormal production environment server and the target traffic time period;

[0088] The scheduling module is used to schedule the traffic to be tested to the test environment server according to the production traffic frequency and the start time of the traffic playback.

[0089] In one possible implementation, the response message further includes a response identifier, and the determining module 702 is further configured to pre-determine a response set based on the configuration information;

[0090] The determining module 702 is used to determine a response message based on the test identifier, including:

[0091] The determination submodule is used to determine the response message corresponding to the traffic to be tested from the response set based on the test identifier and the response identifier.

[0092] In one possible implementation, the test environment server is configured with a sidecar mode service, and the acquisition module 701 is used to acquire test requests sent by the test environment server, including:

[0093] The acquisition submodule is used to acquire test requests sent by the sidecar mode service according to preset configuration traffic forwarding rules; the configuration traffic forwarding rules include the IP address of the original database, the IP address of the traffic pool corresponding to the original database, and the connection port.

[0094] In one possible implementation, the acquisition module 701 is further configured to acquire the target business indicator error rate of the production environment server.

[0095] The determining module 702 is further configured to determine that the production environment server is an abnormal production environment server if the error rate of the target business indicator meets the preset conditions.

[0096] It should be noted that the steps and related technical features executed by each module in the mirror testing device provided in this application correspond to the method provided in the application embodiment. The description of the device part can be found in the embodiments of the aforementioned method part, and will not be repeated here.

[0097] In summary, this application provides a mirror testing device for a traffic replay platform, comprising an acquisition module, a determination module, and a delayed transmission module. The acquisition module acquires a test request sent by a test environment server, which is a mirror server of an abnormal production environment server, and the test request includes a test identifier. The determination module determines a response message based on the test identifier, and the response message includes a response duration. The delayed transmission module delays the transmission of the response message to the test environment server based on the response duration, and the response message indicates the mirror test result. By mirroring the abnormal production environment server as a test environment server, simulating the production workflow, and delaying the response according to the response duration, the device restores the faulty production environment and, based on the actual situation, delays the response, helping to accurately locate faults, thereby improving the accuracy and efficiency of locating production problems and further improving production efficiency.

[0098] See Figure 8 , Figure 8 This is a schematic diagram of the structure of a mirror testing device disclosed in an embodiment of this application. Based on the mirror testing method provided in the above method embodiment, this application embodiment also provides a mirror testing device, including: a processor, a memory, and a system bus;

[0099] The processor and the memory are connected via the system bus;

[0100] The memory is used to store one or more programs, the one or more programs including instructions that, when executed by the processor, cause the processor to perform the mirror testing method described in any of the above embodiments.

[0101] Based on the image testing method provided in the above embodiments, this application also provides a computer-readable storage medium storing instructions that, when executed on a device, cause the device to perform the image testing method described in any of the above embodiments.

[0102] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. The apparatus and apparatus embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. Components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0103] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0104] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A mirror testing method, characterized in that, The method is applied to a traffic replay platform, including: Obtain a test request sent by a test environment server, wherein the test environment server is a mirror server of an abnormal production environment server, and the test request includes a test identifier; The response message is determined based on the test identifier, and the response message includes the actual response time in the abnormal production environment; Based on the actual response time, the response message is delayed and sent to the test environment server to restore the abnormal production environment and the corresponding production status. The response message is used to indicate the image test results. The method further includes: Obtain configuration information and production traffic frequency. The configuration information includes the IP address of the abnormal production environment server, the target traffic time period, and the start time of traffic replay. The traffic to be tested is determined based on the IP address of the abnormal production environment server and the target traffic time period. Based on the production traffic frequency and the start time of the traffic replay, the traffic to be tested is scheduled to the test environment server.

2. The method according to claim 1, characterized in that, The response message also includes a response identifier, and the method further includes: The response set is determined in advance based on the configuration information; The step of determining the response message based on the test identifier includes: The response message corresponding to the traffic to be tested is determined from the response set based on the test identifier and the response identifier.

3. The method according to claim 1, characterized in that, The test environment server is configured with a sidecar mode service, and the step of obtaining the test request sent by the test environment server includes: Obtain the test request sent by the sidecar mode service according to the preset configured traffic forwarding rules; The configured traffic forwarding rules include the IP address of the original database, the IP address of the traffic pool corresponding to the original database, and the connection port.

4. The method according to claim 1, characterized in that, The method further includes: Obtain the error rate of the target business metrics for the production environment server; If the error rate of the target business indicator meets the preset conditions, then the production environment server is determined to be an abnormal production environment server.

5. A mirror testing device, characterized in that, The device is used in a traffic playback platform and includes: The acquisition module is used to acquire test requests sent by the test environment server, as well as to acquire configuration information and production traffic frequency. The test environment server is a mirror server of the abnormal production environment server. The test request includes a test identifier, and the configuration information includes the IP address of the abnormal production environment server, the target traffic time period, and the start time of traffic replay. The determination module is used to determine the response message based on the test identifier, and to determine the traffic to be tested based on the IP address of the abnormal production environment server and the target traffic time period, wherein the response message includes the actual response time in the abnormal production environment; The delayed sending module is used to delay sending the response message to the test environment server based on the actual response time, so as to restore the abnormal production environment and the corresponding production status. The response message is used to indicate the mirror test results. The scheduling module is used to schedule the traffic to be tested to the test environment server according to the production traffic frequency and the start time of the traffic replay.

6. The apparatus according to claim 5, characterized in that, The response message also includes a response identifier, and the determining module is further configured to pre-determine a response set based on the configuration information; The determining module is used to determine the response message based on the test identifier, including: The determination submodule is used to determine the response message corresponding to the traffic to be tested from the response set based on the test identifier and the response identifier.

7. The apparatus according to claim 5, characterized in that, The test environment server is configured with a sidecar mode service. The acquisition module is used to acquire test requests sent by the test environment server, including: The acquisition submodule is used to acquire test requests sent by the sidecar mode service according to preset configuration traffic forwarding rules; the configuration traffic forwarding rules include the IP address of the original database, the IP address of the traffic pool corresponding to the original database, and the connection port.

8. The apparatus according to claim 5, characterized in that, The acquisition module is also used to acquire the error rate of the target business metrics of the production environment server; The determining module is further configured to determine that if the error rate of the target business indicator meets a preset condition, then the production environment server is determined to be an abnormal production environment server.