Online comparison verification method based on flow replication and related device

Through the online comparison and verification method based on traffic replication, the problem of post-container application function and performance verification of cloud-native projects is solved. The virtual machine and containerized cluster are compared using traffic replication tools and MOCK methods, and the application migration is realized The subsequent functional and performance verification ensures the stability and performance indicators of the application.

CN119248424APending Publication Date: 2025-01-03PING AN BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411346200.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

It is difficult to verify the application functions and performance after the cloud-native project, and the existing technology cannot effectively verify the functions and performance of applications after containerized migration.

Method used

Using an online comparison and verification method based on traffic replication, the service traffic is replicated, transmitted to the virtual machine cluster and containerized cluster, and the two operation results are compared and verified, using traffic replication tools such as tcpcopy, goreplay and tcpreplay Simulate the production environment, combine MOCK method and asynchronous calls to achieve automated comparison.

Benefits of technology

It realizes effective verification of application functions and performance after upper capacity, ensures that the stability and performance indicators of the application after migration meet expectations, saves testing time, and improves testing efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248424A_ABST
    Figure CN119248424A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of automatic testing, and provides an online comparison verification method based on flow replication and a related device, and the method comprises the steps: copying a service flow according to a service interface, and obtaining a copied flow; transmitting the service traffic to a virtual machine cluster, and transmitting the copy traffic to a containerized cluster; the operation result of the virtual machine cluster and the operation result of the containerized cluster are compared and verified; therefore, according to the embodiment of the invention, the traffic of the corresponding service interface can be copied, the copied traffic is accessed to the on-capacity application, and the on-capacity and virtual cluster results are observed or automatically compared, so that the purpose of on-line comparison verification is achieved, and the function and performance verification of the on-capacity application can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automated testing technology, and in particular to an online comparison and verification method based on traffic replication and a related device. Background Art

[0002] Cloud-native projects refer to applications or systems designed and built specifically for cloud environments. Such projects make full use of the characteristics of cloud computing, such as elastic scaling, microservice architecture, continuous integration / continuous deployment (CI / CD), and containerization, to achieve more efficient and reliable software development and operation and maintenance. With the launch of cloud-native projects, more and more applications are beginning to be containerized, and one of the important means of ensuring the quality of uploading is the online verification solution, that is, how to verify that the functions and performance of the application are not affected after uploading. This is a technical problem that needs to be solved urgently. Summary of the invention

[0003] The present application provides an online comparison and verification method and related devices based on traffic replication, which are conducive to the function and performance verification of the application after uploading.

[0004] To achieve the above objectives, in a first aspect, the present application provides an online comparison and verification method based on traffic replication, and the online comparison and verification method based on traffic replication comprises the following steps:

[0005] The service traffic is copied according to the service interface to obtain the copied traffic;

[0006] Transmitting the service traffic to a virtual machine cluster, and transmitting the replication traffic to a containerized cluster;

[0007] The operating results of the virtual machine cluster and the operating results of the containerized cluster are compared and verified.

[0008] In addition, to achieve the above-mentioned purpose, in a second aspect, the present application also provides an online comparison and verification device based on traffic replication, and the online comparison and verification device based on traffic replication includes:

[0009] A replication unit, used for replicating service traffic according to a service interface to obtain replicated traffic;

[0010] An operation unit, configured to transmit the service traffic to a virtual machine cluster and transmit the replication traffic to a containerized cluster;

[0011] The comparison and verification unit is used to compare and verify the operation result of the virtual machine cluster and the operation result of the containerized cluster.

[0012] In addition, to achieve the above-mentioned purpose, in the third aspect, the present application also provides a computer device, which includes a processor, a memory, and an online comparison and verification program based on traffic replication stored on the memory and executable by the processor, wherein when the online comparison and verification program based on traffic replication is executed by the processor, the steps of the online comparison and verification method based on traffic replication as described above are implemented.

[0013] In addition, to achieve the above-mentioned purpose, in the fourth aspect, the present application also provides a computer-readable storage medium, on which an online comparison and verification program based on traffic replication is stored, wherein when the online comparison and verification program based on traffic replication is executed by the processor, the steps of the online comparison and verification method based on traffic replication as described above are implemented.

[0014] The present application discloses an online comparison and verification method based on traffic replication and related devices, which replicate the business traffic according to the business interface to obtain replicated traffic; transmit the business traffic to a virtual machine cluster, and transmit the replicated traffic to a containerized cluster; compare and verify the operation results of the virtual machine cluster and the operation results of the containerized cluster; it can be seen that the application embodiment can replicate the traffic of the corresponding business interface, connect the replicated traffic to the upstream application, and achieve the purpose of online comparison and verification by observing or automatically comparing the results of the upstream and virtual clusters, which is conducive to realizing the function and performance verification of the application after the upstream. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0016] Figure 1 A flowchart of a first embodiment of an online comparison and verification method based on traffic replication provided by an embodiment of the present application;

[0017] Figure 2 This is a schematic flow chart of a second embodiment of an online comparison and verification method based on traffic replication provided by an embodiment of the present application. ;

[0018] Figure 3 It is a schematic flow chart of a third embodiment of an online comparison and verification method based on traffic replication provided by an embodiment of the present application;

[0019] Figure 4 It is a schematic flow chart of a fourth embodiment of an online comparison and verification method based on traffic replication provided by an embodiment of the present application;

[0020] Figure 5 is a schematic flow chart of a fifth embodiment of an online comparison and verification method based on traffic replication provided by an embodiment of the present application;

[0021] Figure 6 It is a schematic block diagram of a first embodiment of an online comparison and verification device based on traffic replication provided by an embodiment of the present application;

[0022] Figure 7 It is a schematic block diagram of a second embodiment of an online comparison and verification device based on traffic replication provided by an embodiment of the present application;

[0023] Figure 8 It is a schematic block diagram of a third embodiment of an online comparison and verification device based on traffic replication provided by an embodiment of the present application;

[0024] Fig. 9 is a schematic block diagram of a fourth embodiment of an online comparison and verification device based on traffic replication provided by an embodiment of the present application,

[0025] Fig.10 It is a schematic block diagram of a fifth embodiment of an online comparison and verification device based on traffic replication provided by an embodiment of the present application;

[0026] Fig.11 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0028] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0029] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0030] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0031] The embodiment of the present application provides an online comparison and verification method based on traffic replication and a related device. The online comparison and verification method based on traffic replication can be applied to a terminal or a server to implement the function and performance verification of the application after uploading. The server can be an independent server or a server cluster.

[0032] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0033] Reference Figure 1 , Figure 1 The flowchart of the first embodiment of an online comparison and verification method based on traffic replication provided by the embodiment of the present application. The online comparison and verification method based on traffic replication can be applied to a terminal or a server to implement the function and performance verification of the application after uploading. Figure 1 As shown, the online comparison and verification method based on traffic replication specifically includes steps S101 to S103.

[0034] Step S101: Duplicate service traffic according to a service interface to obtain duplicate traffic.

[0035] Among them, the business interface refers to the way of interaction and data exchange between different modules or systems in a software system or business process.

[0036] Traffic replication is a technical means to capture and replicate network traffic packets in a network environment so that these traffic can be replayed in another environment. This technology is very useful in software development and testing because it can help developers simulate the real traffic of the production environment in a non-production environment, thereby verifying whether the behavior of the application is as expected, and evaluating the performance and stability of the system.

[0037] The traffic replication tool may include at least one of the following: tcpcopy, goreplay, tcpreplay:

[0038] Among them, tcpcopy is a traffic replication tool based on the TCP protocol. It can replicate network traffic in the production environment to the test environment in real time. It is suitable for simulating online user operations to find potential problems before the official grayscale release. It can help the test environment expose problems that are difficult to reproduce in the offline environment.

[0039] Qigoreplay is an open source tool for recording HTTP / HTTPS traffic and replaying it. It supports multiple replay modes, including real-time replay and offline replay. It is suitable for testing the impact of new backend services or API changes on existing systems.

[0040] Among them, tcpreplay is a tool for replaying traffic packets in stored pcap files. It is mainly used for performance testing, security testing, and other network-related testing. Unlike tcpcopy and goreplay, it is mainly used for traffic replay in offline mode.

[0041] These tools and technologies can be selected and used according to different business needs and business scenarios. For example, in a simple traffic replication scenario, you can choose goreplay or tcpcopy; while in a complex traffic replication requirement, you may need to develop a customized solution yourself, such as ByteCopy from ByteDance.

[0042] Step S102: transmitting the service traffic to the virtual machine cluster, and transmitting the replication traffic to the containerized cluster.

[0043] The containerized cluster is called asynchronously. Asynchronous calls to containerized clusters usually mean that after the client initiates a request, it can continue to perform subsequent operations without waiting for the server to respond, while the server processes the request in the background and notifies the client after completion. This method is suitable for processing time-consuming tasks, such as big data processing, machine learning tasks, etc., and can effectively save testing time.

[0044] Among them, the external service of the containerized cluster adopts the MOCK method. MOCK can simulate the behavior of external services so that the test can be carried out independently of the actual service environment, which is very helpful for improving test efficiency and reducing external dependencies. The steps of using the MOCK method in the containerized cluster include: 1. Define MOCK behavior: clarify the external services and their interfaces that require MOCK, as well as the expected response behavior; 2. Implement MOCK service: use the MOCK framework or tool to implement MOCK service; 3. Integrate MOCK service: integrate the MOCK service into the containerized cluster so that it can replace the real external service in the test environment; 4. Test verification: use the MOCK service for testing to verify whether the behavior of the containerized cluster meets expectations.

[0045] Step S103: Compare and verify the operation result of the virtual machine cluster and the operation result of the containerized cluster.

[0046] Comparing and verifying the running results of two clusters usually involves the following steps:

[0047] Define comparison criteria: First, you need to identify the specific indicators to be compared, such as performance indicators, resource utilization, response time, etc.

[0048] Collect data: Collect relevant data from both clusters. This can be done through monitoring tools, log analysis, or manual collection.

[0049] Data analysis: Analyze the collected data to identify differences and try to understand the reasons behind these differences.

[0050] Result verification: Based on the analysis results, verify whether the behavior of the two clusters is as expected.

[0051] Specifically, the defined comparison criteria may include, for example, at least one of the following: performance indicators, service quality, reliability, cost-effectiveness, etc., wherein the performance indicators include but are not limited to CPU usage, memory usage, disk I / O, network bandwidth, etc. Service quality includes but is not limited to response time, throughput, delay, etc. Reliability includes but is not limited to fault recovery time, system availability, etc. Cost-effectiveness includes but is not limited to resource consumption, cost efficiency, etc.

[0052] Specifically, data collection can be achieved through at least one of monitoring tools, log analysis, and performance testing tools. Monitoring tools, for example, can use monitoring tools such as Prometheus and Grafana to collect cluster monitoring data. Log analysis, for example, can use ELK Stack (Elasticsearch, Logstash, Kibana) or other log management systems to analyze log files. Performance testing tools, for example, can use tools such as JMeter and LoadRunner to simulate loads and collect performance data.

[0053] Specifically, data analysis can be at least one of data comparison, trend analysis, and troubleshooting. Data comparison can be, for example, using statistical analysis tools (such as Python's Pandas library) to compare the performance indicators of two clusters. Trend analysis can be, for example, observing trend changes over a period of time and identifying abnormal situations. Troubleshooting can be, for example, analyzing log files to find possible fault points.

[0054] This application replicates the service traffic according to the service interface to obtain the replicated traffic; transmits the service traffic to the virtual machine cluster, and transmits the replicated traffic to the containerized cluster; and compares and verifies the operation results of the virtual machine cluster and the operation results of the containerized cluster. It can be seen that the application embodiment can replicate the traffic of the corresponding service interface, connect the replicated traffic to the upstream application, and achieve the purpose of online comparison and verification by observing or automatically comparing the results of the upstream and virtual clusters, which is conducive to the function and performance verification of the application after the upload.

[0055] See also Figure 2 , Figure 2 It is a schematic flow chart of a second embodiment of an online comparison and verification method based on traffic replication provided in an embodiment of the present application.

[0056] Step S201: Duplicate the service traffic according to the service interface to obtain duplicate traffic.

[0057] Step S202: Transmit the service traffic to the virtual machine cluster, and transmit the replication traffic to the containerized cluster.

[0058] Step S203: Compare and verify the operation result of the virtual machine cluster and the operation result of the containerized cluster.

[0059] Step S204: If the error between the operating result of the virtual machine cluster and the operating result of the containerized cluster is greater than or equal to a preset error, it is determined that the function and performance of the application are affected after being migrated to the container.

[0060] It should be noted that the specific implementation of steps S201 to S203 refers to steps S101 to S103 in the first embodiment, which will not be described in detail again.

[0061] Specifically, for example, if the running result is CPU usage, the preset error may be that the difference in CPU usage is no more than 1%, 3%, 5%, 7%, etc.; when the running result is memory usage, the preset error may be that the difference in memory usage is no more than 1%, 3%, 5%, 7%, etc.; when the running result is network bandwidth, the difference in network bandwidth is no more than 1%, 3%, 5%, 7%, etc. of the virtual machine cluster, and other examples are not given one by one.

[0062] The embodiment of the present application is based on the first embodiment. After comparing and verifying the running results of the virtual machine cluster and the running results of the containerized cluster, it is further determined that the error between the running results of the virtual machine cluster and the running results of the containerized cluster is greater than or equal to a preset error, so as to determine whether the function and performance of the application are affected after being migrated to the container. A method for determining whether the function and performance of the application are affected after being migrated to the container is provided.

[0063] See also Figure 3 , Figure 3 It is a schematic flow chart of a third embodiment of an online comparison and verification method based on traffic replication provided in an embodiment of the present application.

[0064] Step S301: Acquire the service interface of the application, and determine the service flow of each service interface according to the number of calls of each service interface.

[0065] Step S302: Reduce the service flow of each service interface in equal proportion, and arrange them in the calling order of the service interfaces to obtain duplicated flow, where the duplicated flow is smaller than the service flow.

[0066] Step S303: Transmit the service traffic to the virtual machine cluster, and transmit the replication traffic to the containerized cluster.

[0067] Step S304: Compare and verify the operating results of the virtual machine cluster and the operating results of the containerized cluster.

[0068] Step S305: If the error between the operating result of the virtual machine cluster and the operating result of the containerized cluster is greater than or equal to a preset error, it is determined that the function and performance of the application after migration to the container are affected.

[0069] Among them, business interface refers to the interface used for interaction between different components in the software system. These interfaces define how components communicate and exchange data. In enterprise-level applications, business interfaces are very important because they ensure the modularity and scalability of the system, allowing different business logic and services to collaborate with each other.

[0070] Business interfaces include at least one of the following: API (Application Programming Interface), WebService, and message queue. API is a protocol or standard that allows different software programs to communicate with each other. It can be internal (used within the same application) or external (for other applications to call). Web Service is a service that is publicly available on the Internet, usually using the HTTP protocol and transmitting data in XML or JSON format, including SOAP, RESTful API and other forms. Message queue is an asynchronous communication mode that achieves decoupling between services through message queues. Common message queues include RabbitMQ, Kafka, etc.

[0071] Based on the second embodiment, the embodiment of the present application further discloses a method of how to copy the business traffic according to the business interface to obtain the copied traffic. It can be seen that in the embodiment of the present application, firstly, the business traffic of each business interface is determined according to the number of calls of each business interface, which is faster than the data inflow and outflow of each business interface, and there is no need to wait for the entire business process to run; secondly, the business traffic of each business interface is proportionally reduced, so that the entire business traffic is proportionally scaled, saving the test process time; finally, the business interfaces are arranged in the order of calling, which does not change the inflow order of business data in the business process, and is more in line with the original operation in the virtual machine cluster, making the comparison and verification results more accurate.

[0072] See also Figure 4 , Figure 4 It is a schematic flow chart of a fourth embodiment of an online comparison and verification method based on traffic replication provided in an embodiment of the present application.

[0073] Step S401: Build a containerized cluster and confirm that the containerized cluster has been deployed and is running normally.

[0074] Step S402: deploy the application service that needs to receive traffic into the containerized cluster, and route the traffic to different application services.

[0075] Step S403: Capture actual business traffic of different application services.

[0076] Step S404: Process the service traffic to obtain duplicate traffic.

[0077] Step S405: Transmit the service traffic to the virtual machine cluster, and transmit the replication traffic to the containerized cluster.

[0078] Step S406: Compare and verify the operating results of the virtual machine cluster and the operating results of the containerized cluster.

[0079] Step S407: If the error between the running result of the virtual machine cluster and the running result of the containerized cluster is greater than or equal to a preset error, it is determined that the function and performance of the application are affected after being migrated to the container.

[0080] Among them, the tool for building a containerized cluster can be, for example, a tool such as Kubernetes (K8s). The tool for routing traffic can be, for example, an Ingress controller (such as Nginx Ingress Controller, Traefik, etc.). The tool for capturing traffic can be, for example, tcpreplay, tcpcopy, etc. The traffic replay tool is, for example, tcpreplay.

[0081] Specifically, confirm that the containerized cluster has been deployed and is running normally, including: checking the cluster status, checking the node status of the cluster, verifying the health of the container, checking the service configuration, checking the load balancer and entry point, checking monitoring and logs, performing functional testing, checking the resource usage of the cluster, and verifying security and compliance.

[0082] After completing the above steps, if everything runs as expected, the containerized cluster can be considered deployed and running normally. If there are any problems, troubleshoot and fix them according to the specific situation of the problem.

[0083] Among them, check the cluster status. For a Kubernetes cluster, you can use kubectl cluster-info to view the basic information of the cluster to ensure that the cluster is in an operational state; check the node status of the cluster and use the kubectl getnodes command to confirm that all nodes are in the Ready state; verify the health of the container and use kubectl getpods--all-namespaces to list all Pods and confirm that their states are Running or Completed. If any Pod is in Error or CrashLoopBackOff state, further investigation is required to find out the cause; check whether the services are configured correctly and can correctly route traffic to the backend Pods, use kubectl describe svc <service-name>to obtain detailed information about the service; check the load balancer and entry point: if the cluster uses a load balancer or other network components, ensure that these components are configured correctly and that external traffic can reach the services in the cluster; view monitoring and logs, use monitoring tools in the cluster (such as Prometheus, Grafana, etc.) to view the performance indicators of the cluster and applications, check the logs of the cluster and containers to ensure that there are no abnormal error messages; perform functional testing, access services on the cluster, ensure that all functions work as expected, and perform some basic functional testing to ensure that key business processes can be executed smoothly; check the resource usage of the cluster, such as CPU, memory, storage, etc., to ensure that they do not exceed the limit or approach the bottleneck; confirm security and compliance, and confirm that the cluster complies with security policies, such as network policies (Network Policies), RBAC (Role-Based Access Control), etc.

[0084] Specifically, the application service that needs to receive traffic is deployed into the containerized cluster, and traffic is routed to different application services, including: preparing application services, configuring Deployment, creating Service, deploying application services, checking deployment status, routing traffic to different application services, deploying and checking Ingress, and testing traffic routing.

[0085] Among them, prepare the application service, ensure that the application service has been packaged into a Docker image and has been pushed to the Docker registry (such as Docker Hub, Harbor, etc.); configure Deployment, create a KubernetesDeployment file for deploying the application service; create Service, create a Kubernetes Service file for exposing the application service; deploy the application service, use the kubectl command to deploy the application service: check the deployment status to ensure that everything is normal: route traffic to different application services, which can be achieved using Kubernetes Ingress; deploy the Ingress configuration file: check the Ingress status; test traffic routing, test whether the traffic routing is correct by accessing different URL paths: ensure that the traffic is correctly routed to different application services.

[0086] Specifically, to capture actual business traffic, you can use Kubernetes Service or deploy Service files.

[0087] Furthermore, you can also use resource objects such as Deployment or StatefulSet to manage application services.

[0088] Furthermore, the method also includes: ensuring that the captured data packet contains all necessary service request and response information.

[0089] Furthermore, the method further comprises: processing the captured data packets, such as filtering irrelevant traffic, modifying IP addresses, etc. Adjusting the order or repetition times of the data packets as required.

[0090] Furthermore, the method also includes: using a load balancer or other mechanism to ensure uniform distribution of traffic.

[0091] Based on the second embodiment, the embodiment of the present application discloses a method for replicating business traffic according to a business interface to obtain replicated traffic. The present application builds a containerized cluster, confirms that the containerized cluster has been deployed and is running normally, deploys the application service that needs to receive traffic to the containerized cluster, routes traffic to different application services, and then captures the actual business traffic of different application services, processes the business traffic, and obtains replicated traffic, thereby achieving the acquisition of replicated traffic.

[0092] See also Figure 5 , Figure 5 It is a schematic flow chart of the fifth embodiment of an online comparison and verification method based on traffic replication provided in an embodiment of the present application.

[0093] Step S501: Issue a containerized cluster creation request in a Kubernetes cluster environment.

[0094] Step S502: monitor the operation process of the virtual machine cluster according to the containerized cluster creation request.

[0095] Step S503: Create a containerized cluster according to the running process.

[0096] Step S504: confirm that the containerized cluster has been deployed and is running normally.

[0097] Step S505: deploy the application service that needs to receive traffic into the containerized cluster, and route the traffic to different application services.

[0098] Step S506: Capture actual business traffic of different application services.

[0099] Step S507: Process the service traffic to obtain duplicate traffic.

[0100] Step S508: Transmit the service traffic to the virtual machine cluster, and transmit the replication traffic to the containerized cluster.

[0101] Step S509: Compare and verify the operating results of the virtual machine cluster and the operating results of the containerized cluster.

[0102] Step S510: If the error between the operating result of the virtual machine cluster and the operating result of the containerized cluster is greater than or equal to a preset error, it is determined that the function and performance of the application after migration to the container are affected.

[0103] Specifically, to issue a containerized cluster creation request, you can write a YAML file to define the resources you want to create, such as Pods, Services, Deployments, etc., then install and configure kubectl, and use kubectl apply -f <your-file>Submit the .yaml configuration file to the Kubernetes cluster.

[0104] Specifically, monitor the running process of the virtual machine cluster, for example, you can use kubectl monitoring, more specifically, you can use kubectl get pods or kubectl describe pod <pod-name>Wait for commands to monitor the status of the Pod.

[0105] Specifically, to create a containerized cluster, you can submit the configuration file using kubectl apply, and Kubernetes will automatically create the corresponding resources. For Pods, Kubernetes will automatically schedule the container to run on the appropriate node according to the defined configuration. Alternatively, the Deployment controller will ensure that the number of defined Pod replicas always meets the requirements. If a Pod fails, the Deployment will automatically restart or reschedule.

[0106] Based on the fourth embodiment, the embodiment of the present application further discloses a specific embodiment of building a containerized cluster. In the embodiment of the present application, by issuing a containerized cluster creation request in a Kubernetes cluster environment, monitoring the running process of the virtual machine cluster according to the containerized cluster creation request, and creating a containerized cluster according to the running process, the containerized cluster is created.

[0107] See also Figure 6 , Figure 6 This is a schematic block diagram of a first embodiment of an online comparison and verification device based on traffic replication provided by an embodiment of the present application, and the online comparison and verification device based on traffic replication is used to execute the aforementioned online comparison and verification method based on traffic replication. The online comparison and verification device based on traffic replication can be configured on a terminal or a server.

[0108] like Figure 6 As shown, the online comparison and verification device 600 based on traffic replication includes:

[0109] A replication unit 610, configured to replicate the service traffic according to the service interface to obtain replicated traffic;

[0110] An operation unit 620 is used to transmit the service traffic to the virtual machine cluster and transmit the replication traffic to the containerized cluster;

[0111] The comparison and verification unit 630 is used to compare and verify the operation result of the virtual machine cluster and the operation result of the containerized cluster.

[0112] Specifically, see Figure 7 , Figure 7 It is a schematic block diagram of a second embodiment of an online comparison and verification device based on traffic replication provided by an embodiment of the present application. When the service traffic is replicated according to the service interface to obtain the replicated traffic, the replication unit 610 includes:

[0113] The service flow determination module 6111 is used to obtain the service interface of the application and determine the service flow of each service interface according to the number of calls of each service interface;

[0114] The duplicate traffic determining unit 6112 is used to reduce the service traffic of each of the service interfaces in equal proportion and arrange them in the calling order of the service interfaces to obtain duplicate traffic, where the duplicate traffic is smaller than the service traffic.

[0115] Furthermore, the containerized cluster is called in an asynchronous manner.

[0116] Furthermore, the external service of the containerized cluster adopts the MOCK method.

[0117] For further information, see Figure 8 , Figure 8 It is a schematic block diagram of a third embodiment of an online comparison and verification device based on traffic replication provided by an embodiment of the present application. After comparing and verifying the operation results of the virtual machine cluster and the operation results of the containerized cluster, the online comparison and verification device based on traffic replication 600 also includes:

[0118] The function and performance determination unit 640 is configured to determine that the function and performance of the application after being migrated to the container are affected if the error between the operation result of the virtual machine cluster and the operation result of the containerized cluster is greater than or equal to a preset error.

[0119] Specifically, see Fig. 9 , Fig. 9 It is a schematic block diagram of a fourth embodiment of an online comparison and verification device based on traffic replication provided by an embodiment of the present application. In the process of replicating the service traffic according to the service interface to obtain the replicated traffic, the replication unit 610 includes:

[0120] The containerized cluster deployment module 6121 is used to build a containerized cluster and confirm that the containerized cluster has been deployed and is running normally;

[0121] An application service deployment module 6122, used to deploy application services that need to receive traffic into the containerized cluster and route traffic to different application services;

[0122] The duplicate traffic processing module 6123 is used to capture the actual business traffic of different application services and process the business traffic to obtain duplicate traffic.

[0123] Specifically, see Fig.10 , Fig.10 It is a schematic block diagram of a fifth embodiment of an online comparison and verification device based on traffic replication provided by an embodiment of the present application. The containerized cluster is built, and the containerized cluster deployment module 6121 includes:

[0124] The containerized cluster creation request submodule 6121a is used to issue a containerized cluster creation request in a Kubernetes cluster environment;

[0125] A virtual machine cluster monitoring submodule 6121b is used to monitor the operation process of the virtual machine cluster according to the containerized cluster creation request;

[0126] The containerized cluster creation module 6121c is used to create a containerized cluster according to the running process.

[0127] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0128] The above-mentioned device can be implemented in the form of a computer program. Fig.11 Runs on the computer device shown.

[0129] See also Fig.11 , Fig.11 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a terminal or a server.

[0130] See also Fig.11 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0131] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any online comparison and verification method based on traffic replication.

[0132] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0133] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any online comparison and verification method based on traffic replication.

[0134] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will appreciate that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0135] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0136] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0137] The service traffic is copied according to the service interface to obtain the copied traffic;

[0138] Transmitting the service traffic to a virtual machine cluster, and transmitting the replication traffic to a containerized cluster;

[0139] The operating results of the virtual machine cluster and the operating results of the containerized cluster are compared and verified.

[0140] In one embodiment, when the processor implements the copying of the service traffic according to the service interface to obtain the copied traffic, it is configured to implement:

[0141] Obtaining the service interface of the application, and determining the service flow of each service interface according to the number of calls of each service interface;

[0142] The service flow of each of the service interfaces is reduced in proportion and arranged in the order of calling the service interfaces to obtain duplicate flow, which is smaller than the service flow.

[0143] In one embodiment, the containerized cluster is called in an asynchronous manner.

[0144] In one embodiment, the external service of the containerized cluster adopts MOCK mode.

[0145] In one embodiment, after implementing the comparison and verification of the operation result of the virtual machine cluster and the operation result of the containerized cluster, the processor is further used to implement:

[0146] If the error between the running result of the virtual machine cluster and the running result of the containerized cluster is greater than or equal to a preset error, it is determined that the function and performance of the application after migration to the container are affected.

[0147] In one embodiment, when the processor implements the copying of the service traffic according to the service interface to obtain the copied traffic, it is configured to implement:

[0148] Build a containerized cluster and confirm that the containerized cluster has been deployed and is running normally;

[0149] Deploy application services that need to receive traffic into the containerized cluster and route the traffic to different application services;

[0150] Capture the actual business traffic of different application services, process the business traffic, and obtain duplicate traffic.

[0151] In one embodiment, when implementing the building of the containerized cluster, the processor is used to implement:

[0152] Issue a containerized cluster creation request in the Kubernetes cluster environment;

[0153] Monitoring the operation process of the virtual machine cluster according to the containerized cluster creation request;

[0154] Create a containerized cluster according to the described operation process.

[0155] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any one of the online comparison and verification methods based on traffic replication provided in the embodiments of the present application.

[0156] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.

[0157] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. An online comparison and verification method based on traffic replication, characterized in that: The online comparison and verification method based on traffic replication includes the following steps: The service traffic is copied according to the service interface to obtain the copied traffic; Transmitting the service traffic to a virtual machine cluster, and transmitting the replication traffic to a containerized cluster; The operating results of the virtual machine cluster and the operating results of the containerized cluster are compared and verified.

2. The online comparison and verification method based on traffic replication according to claim 1 is characterized in that: The step of duplicating the service traffic according to the service interface to obtain the duplicated traffic includes: Obtaining the service interface of the application, and determining the service flow of each service interface according to the number of calls of each service interface; The service flow of each of the service interfaces is reduced in proportion and arranged in the order of calling the service interfaces to obtain duplicate flow, which is smaller than the service flow.

3. The online comparison and verification method based on traffic replication according to claim 1 is characterized in that: The containerized cluster is called in an asynchronous manner.

4. The online comparison and verification method based on traffic replication according to claim 1 is characterized in that: The external service of the containerized cluster adopts the MOCK method.

5. The online comparison and verification method based on traffic replication according to claim 1 is characterized in that: After comparing and verifying the operating results of the virtual machine cluster and the operating results of the containerized cluster, the method further includes: If the error between the running result of the virtual machine cluster and the running result of the containerized cluster is greater than or equal to a preset error, it is determined that the function and performance of the application after migration to the container are affected.

6. The online comparison and verification method based on traffic replication according to any one of claims 1 to 5, characterized in that: The step of duplicating the service traffic according to the service interface to obtain the duplicated traffic includes: Build a containerized cluster and confirm that the containerized cluster has been deployed and is running normally; Deploy application services that need to receive traffic into the containerized cluster and route the traffic to different application services; Capture the actual business traffic of different application services, process the business traffic, and obtain duplicate traffic.

7. The online comparison and verification method based on traffic replication according to claim 6 is characterized in that: The building of a containerized cluster includes: Issue a containerized cluster creation request in the Kubernetes cluster environment; Monitoring the operation process of the virtual machine cluster according to the containerized cluster creation request; Create a containerized cluster according to the described operation process.

8. An online comparison and verification device based on traffic replication, characterized in that: The online comparison and verification device based on traffic replication includes: A replication unit, used for replicating service traffic according to a service interface to obtain replicated traffic; An operation unit, configured to transmit the service traffic to a virtual machine cluster and transmit the replication traffic to a containerized cluster; The comparison and verification unit is used to compare and verify the operation result of the virtual machine cluster and the operation result of the containerized cluster.

9. A computer device, characterized in that: The computer device includes a processor, a memory, and an online comparison and verification program based on traffic replication stored in the memory and executable by the processor, wherein when the online comparison and verification program based on traffic replication is executed by the processor, the steps of the online comparison and verification method based on traffic replication as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an online comparison and verification program based on traffic replication, wherein when the online comparison and verification program based on traffic replication is executed by the processor, the steps of the online comparison and verification method based on traffic replication as described in any one of claims 1 to 7 are implemented.