Network anomaly simulation test method, device, electronic device and storage medium

By executing simulation test commands in the operating system, network exception simulation tests are directly carried out, and network exception simulation tests are solved in the existing technology, and low-cost and simple-operated network exception simulation tests are realized.

CN115766469BActive Publication Date: 2025-04-01CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211184256.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-27
Publication Date
2025-04-01
Estimated Expiration
2042-09-27

AI Technical Summary

Technical Problem

In the prior art, network abnormality simulation tests are performed by installing software and using external professional detection equipment, which is costly and complex in operation.

Method used

By executing the simulation test start command and the simulation test end command in the operating system, network exception simulation test is performed directly within the operating system, without installing testing software and external devices.

Benefits of technology

It realizes low-cost and simple-to-operate network abnormality simulation test, can intuitively analyze simulation test results, and is suitable for a variety of test systems and scenarios, effectively preventing system problems caused by network abnormalities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115766469B_ABST
    Figure CN115766469B_ABST
Patent Text Reader

Abstract

The present application provides a network anomaly simulation test method, device, electronic device and storage medium, which relate to the field of computer technology. An operating system applied to an electronic device. The method comprises: obtaining first operating information of a system to be tested. Determine a simulation test start command, perform an abnormal simulation test on the system to be tested, obtain and display test information of the system to be tested, so that a user can determine the execution capability of the system to be tested for abnormal simulation testing and the processing capability of the system to be tested according to the test information. Determine a simulation test end command, obtain second operating information of the system to be tested according to the simulation test end command, so that a user can determine the recovery capability of the system to be tested according to the first operating information and the second operating information. By executing a simulation test start command and a simulation test end command in the operating system to implement a network anomaly simulation test, the network anomaly simulation test can be implemented without installing test software, making the test simpler and more convenient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a network anomaly simulation test method, device, electronic device and storage medium. Background Art

[0002] With the development of computer technology, the information system is becoming more and more informationized. In the process of using the system, there are more and more failures caused by network problems. Therefore, in order to avoid the recurrence of similar failure events, it is necessary to simulate the network abnormality scenario in advance and conduct abnormal simulation tests on the system to be tested to obtain the response of the system to be tested when facing the network abnormality scenario, so that the tester can optimize the system according to the test results.

[0003] At present, many network overall testing methods are to install designated software on the test host and use professional monitoring equipment such as network damage tester to simulate the abnormal state of the network, and obtain the test results of the system to be tested under the abnormal state of the network by testing one or more indicators such as delay, jitter, lateness, repetition, disorder, packet loss, etc. The network damage tester is expensive, and professionals are required to install software on the test host every time a network abnormality simulation test is performed. Therefore, this method of installing software and using external professional detection equipment to perform network abnormality simulation testing is costly and complicated to operate. Summary of the invention

[0004] The present application provides a network anomaly simulation test method, device, electronic device and computer-readable storage medium, which are used to solve the problem in the prior art that the method of performing network anomaly simulation test by installing software and using external professional detection equipment is costly and complicated to operate.

[0005] In a first aspect, the present application provides a network abnormality simulation test method, which is applied to an operating system of an electronic device, the method comprising: obtaining first operating information of a system to be tested; determining a simulation test start command, performing an abnormal simulation test on the system to be tested according to the simulation test start command, obtaining and displaying test information of the system to be tested, so that a user can determine the execution capability of the system to be tested for the abnormal simulation test according to the test information and the expected test result, wherein if the test information and the expected test result are inconsistent, the execution capability of the system to be tested for the abnormal simulation test is determined to be not executed, and if the test information and the expected test result are consistent, the execution capability of the system to be tested for the abnormal simulation test is determined to be executed, and the method is used for the user to determine the processing capability of the system to be tested according to the test information; determining a simulation test end command, and obtaining second operating information of the system to be tested according to the simulation test end command, so that the user can determine the recovery capability of the system to be tested according to the first operating information and the second operating information, wherein if the second operating information is consistent with the first operating information, the abnormal simulation test of the system to be tested passes, and the recovery capability is to recover to normal, and if the second operating information is inconsistent with the first operating information, the abnormal simulation test of the system to be tested fails, and the recovery capability is to recover to abnormal.

[0006] The network anomaly simulation test method provided by the implementation method of the present application implements the network anomaly simulation test by executing the test commands of the simulation test start command and the simulation test end command in the operating system. Thus, the network anomaly simulation test can be implemented without installing the test software. Furthermore, based on the test information of the system to be tested obtained during the simulation test, it can be used for the user to determine the execution capability of the system to be tested according to the test information and the expected test results, that is, whether the system to be tested has executed the network anomaly simulation test. If the test information is consistent with the expected test results, it means that the execution capability of the system to be tested for the network anomaly simulation test has been executed. If it has been executed, the user can determine the processing capability of the system to be tested in the network anomaly state according to the test information, that is, the user can determine whether the system to be tested has the processing capability to face the network anomaly according to the test information. Among them, the expected test result is determined according to the simulation test start command.

[0007] Furthermore, it is possible to observe whether the system to be tested has the ability to recover to the original level after experiencing the network anomaly simulation based on the first operation information and the second operation information. That is, it is determined whether the second operation information obtained is consistent with the first operation information. If they are consistent, it means that the system to be tested has the ability to recover. If they are inconsistent, it means that the system to be tested has failed the network anomaly simulation test.

[0008] Therefore, based on the test command, it is possible to intuitively analyze whether the simulation test is appropriate, and the simulation test can be performed without professional testers and the test results can be intuitively observed. The simulation test based on the operating system by executing the test command is simple to operate, and no external equipment is required, thus reducing the test cost, and no test software needs to be installed. Moreover, based on the test command simulation test, different test scenarios can be simulated, and the simulation tests are diverse. Because it is an operating system test, there is no need to pass through other test equipment, and the test results do not need to be transmitted, which reduces test interference and makes the test results reliable and practical. In addition, testing based on the operating system can be applicable to a variety of test systems and test scenarios. Based on the simulation test performed in advance, various problems that may occur in the system to be tested when a network anomaly is actually encountered are effectively prevented.

[0009] In one implementation of the network anomaly simulation test method provided in the implementation of the present application, the method also includes: real-time monitoring of time nodes; generating a test report based on the time nodes, and the first operation information, test information and second operation information corresponding to the time nodes.

[0010] In the implementation of the present application, by monitoring the switching time node, the test personnel can conveniently view the entire test process. By obtaining the first operation information before the simulation test, the test information during the simulation test, and the second operation information after the simulation test, this information is recorded to generate a test report, which is convenient for the test personnel to view the state changes and performance changes of the system to be tested during the entire test cycle.

[0011] In one implementation of the network anomaly simulation test method provided in the implementation of the present application, first operating information of the system to be tested is obtained, including: obtaining the maximum processing capacity and a preset pressure threshold of the system to be tested; determining the load pressure of the system to be tested according to the maximum processing capacity and the preset pressure threshold; after running the system to be tested according to the load pressure, obtaining the first operating information of the system to be tested.

[0012] That is, in the implementation of the present application, according to the ratio of test transactions in the mixed test scenario, the pressure of the preset pressure threshold of the maximum processing capacity of the system to be tested is used as the load pressure, and the system to be tested is operated according to the load pressure, so that the system to be tested can be simulated under a stable pressure state.

[0013] In one implementation of the network anomaly simulation test method provided in the implementation method of the present application, the first operation information includes the initial processing capacity value of the system to be tested and the status information of the system to be tested; the test information includes the test data of the system to be tested and the status information of the system to be tested; the second operation information includes the recovery processing capacity value of the system to be tested and the status information of the system to be tested.

[0014] In the implementation of the present application, it is possible to determine whether the system to be tested has executed the simulation test, that is, whether the network anomaly simulation execution status is executed or not executed, based on the test data. And the network anomaly data processing capability of the system to be tested in the face of network anomalies during the simulation test is determined based on the status information. By monitoring the initial capability value and recovery capability value of the test server and the status information, it is determined whether the system to be tested has the recovery capability under the normal network state.

[0015] In one implementation of the network anomaly simulation test method provided in the implementation of the present application, after the system to be tested is run according to the load pressure, the first operation information of the system to be tested is obtained, including: after the system to be tested is run for a first time according to the load pressure, the first operation information of the system to be tested is obtained.

[0016] In the implementation of the present application, under stable load pressure, and after the system to be tested has been running stably for a first time, the first operation information of the system to be tested in a stable operation state is obtained to obtain the initial operation information (i.e., the first operation information) of the system to be tested in a stable pressure state without undergoing a network abnormality simulation test.

[0017] In one implementation of the network anomaly simulation test method provided in the implementation of the present application, determining a simulation test start command includes: receiving a simulation test start operation from a user to determine a simulation test start command; determining a simulation test end command includes: receiving a simulation test end operation from a user to determine a simulation test end command.

[0018] In the implementation of the present application, the tester inputs the simulation test command (i.e., the simulation test start command and the simulation test end command) in the embedded operating system, without the need to install software and external equipment, thereby reducing the testing cost.

[0019] In one implementation of the network abnormality simulation test method provided in the implementation of the present application, an abnormal simulation test is performed on the system to be tested according to a simulation test start command, and test information of the system to be tested is obtained, including: after the abnormal simulation test is performed on the system to be tested for a second time according to the simulation test start command, the test information of the system to be tested is obtained.

[0020] In the implementation of the present application, the corresponding network abnormality operation is executed according to the simulation test start instruction, and the network abnormality simulation is continuously executed for a second time, and the test information of the system to be tested during the second time is continuously obtained, so that the tester can observe the status of the network abnormality simulation test according to the test information.

[0021] In one implementation of the network anomaly simulation test method provided in the implementation of the present application, second operation information of the system to be tested is obtained according to the simulation test end command, including: obtaining the second operation information of the system to be tested after the system to be tested executes the simulation test end instruction for a third time.

[0022] In the implementation of the present application, the corresponding network abnormal operation is exited according to the simulation test end command, and the network recovery mode is continuously executed for a third time, and the second operation information of the system to be tested after the third time is continuously obtained, so that the tester can observe the recovery capability of the system to be tested according to the second operation information and the first operation information.

[0023] In one implementation of the network anomaly simulation test method provided in the implementation of the present application, the status information includes central processing unit utilization, memory occupancy, system disk busyness, application service process, message queue and database operation status.

[0024] In the implementation method of the present application, in the network anomaly simulation test, whether the system to be tested is in a network anomaly scenario can be monitored based on the status information. The performance and processing capability of the system to be tested in the network anomaly scenario, as well as the recovery capability under the network recovery state can also be monitored based on the status information.

[0025] In one implementation of the network anomaly simulation test method provided in the implementation of the present application, if the simulation test start command includes a test network delay start command, the simulation test end command includes a test network delay end command; if the simulation test start command includes a test packet loss start command, the simulation test end command includes a test packet loss end command; if the simulation test start command includes a test data packet repeat start command, the simulation test end command includes a test data packet repeat end command; if the simulation test start command includes a test data packet damage start command, the simulation test end command includes a test data packet damage end command; if the simulation test start command includes a test data packet disorder start command, the simulation test end command includes a test data packet disorder end command.

[0026] In the implementation of the present application, by simulating various network abnormality scenarios, the response capability, that is, the processing capability, of the system to be tested facing network abnormalities is comprehensively tested.

[0027] In one implementation of the network anomaly simulation test method provided in the implementation method of the present application, if the simulation test start command is a test network delay start command, the test data of the system to be tested includes a data packet delay rate and a transaction log; if the simulation test start command is any one of a test packet loss start command, a test data packet duplication start command, a test data packet damage start command, and a test data packet disorder start command, the test data of the system to be tested includes a data packet error rate and a transaction log.

[0028] In the implementation of the present application, if the simulation test start command is a test network delay start command, the data packet delay rate is calculated to determine whether the simulation test start command is transmitted to the system to be tested and whether the simulation test is successful. If the simulation test start command is any one of a test packet loss start command, a test data packet duplication start command, a test data packet damage start command, and a test data packet disorder start command, the abnormal state of the data packet is the data packet error rate, that is, the data packet error rate is calculated to determine whether the simulation test start command is transmitted to the system to be tested and whether the simulation test is successful. Furthermore, by recording the test log, that is, the transaction log, it is used for testers to view the changes in data packets during the test process and the changes in the state of the system to be tested during the simulation test process.

[0029] In a second aspect, the present application provides a network abnormality simulation test device, comprising: a first acquisition module, used to acquire first operating information of a system to be tested; a first processing module, which performs an abnormal simulation test on the system to be tested according to a simulation test start command, acquires and displays the test information of the system to be tested, so that a user can determine the execution capability of the system to be tested for the abnormal simulation test according to the test information and the expected test result, wherein if the test information and the expected test result are inconsistent, the execution capability of the system to be tested for the abnormal simulation test is determined to be not executed; if the test information and the expected test result are consistent, the execution capability of the system to be tested for the abnormal simulation test is determined to be executed, and the user can determine the processing capability of the system to be tested according to the test information; a second processing module, used to determine a simulation test end command, acquire second operating information of the system to be tested according to the simulation test end command, so that the user can determine the recovery capability of the system to be tested according to the first operating information and the second operating information, wherein if the second operating information is consistent with the first operating information, the abnormal simulation test of the system to be tested passes, and the recovery capability is to recover to normal; if the second operating information is inconsistent with the first operating information, the abnormal simulation test of the system to be tested fails, and the recovery capability is to recover to abnormality.

[0030] The network anomaly simulation test device provided in the present application includes a module for executing the network anomaly simulation test method provided in the first aspect above, and thus can also achieve the beneficial effects (or advantages) possessed by the network anomaly simulation test method provided in the first aspect.

[0031] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the network anomaly simulation test method provided by the implementation method of the first aspect above.

[0032] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the network anomaly simulation test method provided by the implementation method of the first aspect mentioned above.

[0033] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the network anomaly simulation test method provided by the implementation method of the first aspect above.

[0034] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can also be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

[0035] The network anomaly simulation test method provided by the present application implements the network anomaly simulation test by executing the test command of the operating system kernel of the electronic device, and determines the execution capability of the system to be tested during the simulation test based on the test information of the system to be tested obtained during the simulation test, determines whether the system to be tested has the processing capability to deal with the network anomaly based on the state information of the system to be tested obtained during the simulation test, and determines whether the system to be tested has the recovery capability after experiencing the network anomaly based on the operation information before and after the simulation test, that is, the first operation information and the second operation information. Thus, based on the test command, it is possible to intuitively analyze whether the simulation test is appropriate, and the simulation test can be performed without professional testers. The simulation test based on the embedded command of the operating system is simple to operate, and no external equipment is required, thus reducing the test cost, and no test software needs to be installed. Moreover, based on the simulation test of the test command, different test scenarios can be simulated, and the simulation test is diverse, and because it is an operating system test, it is not necessary to pass through other test equipment, so that the test results do not need to be transmitted, reducing test interference, and making the test results reliable and practical. In addition, the test based on the operating system can be applied to a variety of test systems and test scenarios, and the simulation test based on the advance effectively prevents various problems that may occur in the system to be tested when a network anomaly is actually encountered. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0037] Figure 1 A schematic diagram of message classification applicable to an embodiment of the present application;

[0038] Figure 2 A schematic diagram of message transmission applicable to an embodiment of the present application;

[0039] Figure 3This is an application scenario diagram of a network anomaly simulation test method applicable to an embodiment of the present application;

[0040] Figure 4 A flowchart of a network anomaly simulation test method provided in an embodiment of the present application;

[0041] Figure 5 A flowchart of another network anomaly simulation test method provided in an embodiment of the present application;

[0042] Figure 6 A flowchart of another network anomaly simulation test method provided in an embodiment of the present application;

[0043] Figure 7 A schematic diagram of the structure of a network anomaly simulation test device provided in an embodiment of the present application;

[0044] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0045] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0046] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0047] It should be noted that the acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations.

[0048] Terminology explanation:

[0049] Network anomalies: packet transmission delay, packet loss, duplication, damage, disorder, etc.

[0050] With the rapid development of computer technology, the requirements for the informatization of data information systems are getting higher and higher, and more and more versions of informatization systems are being put into production. During the use of the system, production events caused by the network are becoming more and more numerous and more serious, especially when data information systems involve accounting security. Therefore, system performance testing is of utmost importance. In order to avoid similar production events from happening again, it is necessary to simulate abnormal scenarios in advance, test the response of the system to be tested under network abnormalities, and detect whether the system to be tested can give a correct response under network abnormalities. This is the correct way for us to avoid failures in the system in abnormal network states. Therefore, how to simulate network anomalies and conduct tests under abnormal conditions needs to be solved urgently.

[0051] In the prior art, most methods of simulating network anomalies are to simulate network anomaly scenarios through network damage instruments, and simulate various wide area network environments through network damage instruments, that is, to simulate network conditions such as bandwidth limitation, delay, delay jitter, packet loss, disorder, duplicate messages, bit errors, congestion, etc. In the case of laboratory conditions, professional testers test the operation status of the banking system in a real network environment. However, network damage instruments are expensive, and they use external hardware devices to simulate network anomaly status. On the one hand, this method requires professional testers to operate, and on the other hand, the operation is complicated and cannot be obtained and used immediately.

[0052] Based on this, data information systems such as banking systems use self-developed chaos engineering to simulate network abnormalities, to understand the system's ability to respond to various chaotic conditions in the production environment, and to establish system reinforcement. Chaos engineering is generally used by chaos engineers to find the cause of system failures, that is, to obtain the system's resilience when an abnormality occurs and cannot be avoided. By conducting scientific experiments in hybrid engineering, it is possible to test whether the system has defects, so as to understand the system's operating status in an abnormal environment. However, although chaos engineering open source testing tools such as chaosd are simple, they need to be deployed locally, that is, testers are required to perform test deployment within the system, and data information systems have many permissions and security restrictions. If deployment is required, it needs to undergo security verification. Therefore, the development cycle is long and the implementation is difficult. It is easy to be intercepted, and it is impossible to achieve simulation testing of network abnormalities in a short time.

[0053] Therefore, the present application provides a network anomaly simulation test method based on system embedded software, which executes test commands through the operating system to implement network anomaly simulation testing, that is, network anomaly simulation non-functional testing, without the need for external testing equipment, and without having to consider system permissions and security restrictions during network anomaly simulation testing.

[0054] Specifically, taking the Linux operating system as an example, the traffic controller (Traffic Control, referred to as TC) in the Linux operating system is used for the flow control of the Linux kernel. It uses queue regulations to establish a queue for processing data packets and defines the way in which the data packets in the queue are sent, thereby realizing the control of the flow. The queue regulations used by the traffic controller module to implement the flow control function are divided into two categories, one is the classless queue regulation and the other is the classified queue regulation. The classless queue regulation is relatively simple, while the classified queue regulation introduces the concepts of classification and filter, which enhances its flow control function.

[0055] Classless queue rules are queue rules that treat all packets entering a network device (such as a network card) uniformly without distinction. Queues formed using classless queue rules can receive packets and re-arrange, delay, or discard packets. Queues formed by this type of queue rule can shape the traffic of the entire network device, but cannot be subdivided into various situations. Commonly used classless queue rules include pfifo_fast (first in, first out), TBF (token bucket filter), SFQ (random fair queue), ID (forward random packet loss), etc. The traffic shaping methods used by this type of queue rule are mainly sorting, rate limiting, and packet loss.

[0056] The classification queue rules are queue rules that treat packets entering the network device in a classified manner according to different requirements. After a packet enters a classification queue, it needs to be sent to a certain category, that is, the packet needs to be classified. And for the classification queue, some sub-queues have very simple functions. They implement a first-come-first-go strategy for packets, that is, packets. Some sub-queues have complex functions. They will queue and classify different packet packets, and send the packet packets in the queue in different orders according to different principles. To achieve such functions, these complex queues need to use different filters to classify the packet packets into different classes. Here, these complex queues are called classful queues. Generally, classful queues are indispensable to achieve powerful flow control. Therefore, categories and filters are also two other important basic concepts of flow control. By using filters to classify packets, the filters will return a decision based on the received packets, and the queue rules will send the packets to the corresponding class for queuing according to this decision. Each sub-class can use its filter again for further classification. Packets are queued in the queues of the class until no further classification is needed. In addition to being able to contain other queues, most classified queues can also shape traffic. This is very useful for situations where both scheduling (such as using SFQ) and flow control are required.

[0057] For example, Figure 1 As shown, for a classified queue, categories and filters are both internal structures of the queue, and a classifiable queue can contain multiple categories. At the same time, a category can further contain subqueues or subcategories. All message packets entering this category can be placed in different subqueues or subcategories according to different principles, and so on. The filter is a tool used by the queue to classify data packets, which determines which category a data packet will be assigned to. For example, data packets are grouped into category 1 through filter 1, and category 1 also contains subqueues, which can also classify data packets. Data packets are grouped into category 2 through filters 2 and 3, and category 2 also contains subqueues, which can also classify data packets.

[0058] Furthermore, if Figure 2 As shown, whether it is a classless queue or a classified queue, the message, that is, the data packet, is received from the input network card, that is, the entrance. After the route search, it is determined whether the data packet is sent to the local machine or needs to be forwarded. If it is a data packet sent to the local machine, it is directly submitted to the upper layer protocol, such as the Transmission Control Protocol (TCP). If the data packet needs to be forwarded, the data packet will be forwarded from the output network card, that is, the exit, to the corresponding host, that is, sent to other machines. The control of network traffic usually occurs at the output network card, that is, the simulation of the abnormal state of the network will also be performed at the output network card end. Although flow control can also be performed at the entrance of the router, and the Linux operating system also has corresponding functions, in general, due to the inability to control devices outside its own network, the flow control at the entrance will have inaccurate problems. Therefore, the implementation method of this application adopts a method of controlling the flow at the output network card end, that is, controlling the simulation of network abnormality at the output network card end.

[0059] Moreover, according to the above description, traffic control is implemented through queues (Qdisc), and each network card is associated with a queue. Whenever the kernel needs to send a packet from the network card, it will first add the packet to the queue configured by the network card, and the queue determines the order in which the packet is sent. Therefore, in the implementation of this application, embedded commands in the Linux system are used to call classless queues or classified queues, and network abnormalities such as network delay, packet loss, packet duplication, packet damage, and packet disorder are simulated according to queue rules.

[0060] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0061] See also Figure 3 , Figure 3 This is an application scenario diagram of the network anomaly simulation test method provided by the implementation method of this application. Specifically, Figure 3 As shown, the network anomaly simulation test method provided by the implementation of the present application is applied to the operating system of the electronic device, such as the Linux operating system, to perform a simulation test on the system to be tested to verify whether the system to be tested has the ability to cope with the network anomaly state, that is, the processing ability, and whether it has the ability to recover after the network anomaly state ends.

[0062] Therefore, the network anomaly simulation test system provided by the implementation of the present application includes a test host 100 and a system to be tested 200. Among them, the system to be tested includes a test server 210 and a plurality of host devices 220. Among them, the test host 100, the test server 210 and the plurality of host devices 220 can establish a communication connection through a network cable in a wired communication mode based on a router (not shown in the figure), and of course, a communication connection can also be established based on a wireless local area network (WLAN) (such as a wireless fidelity (Wi-Fi) network) where the router is located.

[0063] In the implementation of the present application, the test host 100 controls the output network card of the router to perform a network anomaly simulation test, and the corresponding network anomaly simulation test is performed based on the router, so that the test server 210 and each host device 220 are in a corresponding network anomaly state. The test host 100 determines the processing capability of the system to be tested 200 when facing a network anomaly and the recovery capability of the system to be tested 200 after the network anomaly state is recovered by monitoring the test information of the test server 210 and each host device 220 when they are in the network anomaly state and the operation information before and after the network anomaly state (that is, the first operation information and the second operation information).

[0064] Exemplarily, taking the network delay simulation test as an example, the tester inputs the network delay test start command in the Linux embedded system of the test host 100 and runs it, so as to control the output network card of the router to perform the network delay simulation test, so that the output network card of the router delays the transmission of the message, that is, the data packet to the system to be tested 200, and the test host 100 monitors the test data of the test server 210 (as a partial example of the test information), and determines whether the test server 210 is in the test state according to the test data. The test host also monitors the status information of the test server 210 (as another partial example of the test information), and determines whether the test server 210 can reach the required processing capacity when facing network delay according to the status information of the test server 210.

[0065] Furthermore, the test host 100 also monitors and displays the test data and status information of each host device 220 to determine whether each host device 220 can meet the requirements.

[0066] It should be noted that in the implementation of the present application, each host device 220 can also cooperate with the test host 100 based on the simulation test to synchronously display the test data and status information of its own device on the display interface of its own device.

[0067] Furthermore, the test host 100 also monitors the first operation information of the test server 210 and each test host 220 before starting the network delay test and the second operation information after ending the network delay test to determine the recovery capability of the test server 210 and each test host 220 after experiencing network delay.

[0068] The network anomaly simulation test system provided by the implementation method of the present application implements the network anomaly simulation test by running the test command on the Linux operating system through the Linux kernel built-in command of the test host 100, and based on the test information of the system to be tested 200 obtained during the simulation test, it is determined whether the simulation test is successful, that is, the execution capability of the system to be tested 200 and whether the system to be tested 200 has the processing capability to deal with network anomalies, and based on the operation information before and after the simulation test, that is, the first operation information and the second operation information, it is determined whether the system to be tested 200 has the recovery capability after experiencing network anomalies. Thus, based on the test command, it is possible to intuitively analyze whether the simulation test is appropriate, and the simulation test can be performed without professional testers. The simulation test based on the embedded command execution of the Linux operating system is simple to operate, and no external equipment is required, thereby reducing the test cost, and no test software needs to be installed. Moreover, based on the test command simulation test, different test scenarios can be simulated, and the simulation test is diverse. Because it is an operating system test, it is not necessary to pass through other test equipment, and the test results do not need to be transmitted, which reduces test interference and makes the test results reliable and practical. Moreover, testing based on the operating system can be applied to a variety of test systems and test scenarios. Simulation testing in advance can effectively prevent various problems that may occur in the system to be tested when a network anomaly is actually encountered.

[0069] Next, see Figure 4 , the network anomaly simulation test method provided by the implementation method of this application is described in detail.

[0070] The network anomaly simulation test method provided by the implementation of this application performs the following steps:

[0071] S110: Acquire first operation information of the system to be tested.

[0072] Exemplarily, before the test host 100 performs the network anomaly simulation test, the system to be tested 200 is first monitored to monitor the ability of the system to be tested 200 to process data packets per second, i.e., the initial processing capacity value (TransactionsPerSecond, TPS for short) and the state information of the system to be tested (as an example of the first operation information). The TPS value is determined based on the transactions executed per second, i.e., the executed data packets, of the system to be tested.

[0073] Specifically, the status information includes the CPU utilization, memory usage, system disk busyness, IO busyness, application service process, middleware, message queue, and database operation status.

[0074] In the implementation of the present application, the status of the test server 210 and each host device 22 of the system to be tested 200 before and after the network anomaly simulation test and during the network anomaly simulation test is monitored in real time by acquiring the status information of the system to be tested 200.

[0075] S120, determining a simulation test start command, performing an abnormal simulation test on the system to be tested according to the simulation test start command, acquiring and displaying test information of the system to be tested, so that the user can determine the execution capability of the system to be tested for the abnormal simulation test according to the test information and expected test results.

[0076] Exemplarily, the simulation test start command includes a test network delay start command, which is a command for starting a network delay simulation test, a test packet loss start command, which is a command for starting a network packet loss simulation test, a test data packet repetition start command, which is a command for starting a data packet repetition simulation test, a test data packet damage start command, which is a command for starting a data packet damage simulation test, and a test data packet disorder start command, which is a command for starting a data packet disorder simulation test.

[0077] Specifically, in the implementation method of the present application, by executing a simulation test start command on the test host 100, the test information of the system to be tested 200 is obtained and displayed during the execution process, so that the user can determine the execution capability of the system to be tested 200 for performing an abnormal simulation test based on the test information and the expected test results. If the test information is consistent with the expected test results, the execution capability of the system to be tested 200 for performing an abnormal simulation test is determined to have been executed, and the user can determine the processing capability of the system to be tested 200 based on the test information.

[0078] If the test information is inconsistent with the expected test result, it is determined that the execution capability of the system to be tested 200 for performing the abnormal simulation test is not executed.

[0079] That is, in the implementation of the present application, by acquiring and displaying the test information, it is convenient for the user to determine the execution capability of the system to be tested 200 for the abnormal simulation test according to the test information and the expected test result determined according to the simulation test start command. If the test information is consistent with the expected test result, it means that the system to be tested 200 has performed the abnormal simulation test, and the user can determine the processing capability of the system to be tested 200 for the abnormal simulation test according to the test information. If the test information is inconsistent with the expected test result, it means that the system to be tested 200 has not performed the abnormal simulation test.

[0080] Furthermore, the test information includes test data of the system to be tested 200 and status information of the system to be tested 200 .

[0081] In the implementation of the present application, the execution capability of the system to be tested 200 can be determined according to the test data, and the processing capability of the system to be tested 200 can be determined according to the status information.

[0082] Further, if the simulation test start command is a test network delay start command, the test data of the system to be tested 200 includes a data packet delay rate and a transaction log; if the simulation test start command is any one of a test packet loss start command, a test data packet duplication start command, a test data packet damage start command, and a test data packet disorder start command, the test data of the system to be tested 200 includes a data packet error rate and a transaction log.

[0083] S130, determining a simulation test end command, and obtaining second operation information of the system to be tested according to the simulation test end command, so that the user can determine the recovery capability of the system to be tested according to the first operation information and the second operation information.

[0084] Exemplarily, the simulation test end command includes a test network delay end command, which is a command for ending the network delay simulation test, a test packet loss end command, which is a command for ending the network packet loss simulation test, a test data packet duplication end command, which is a command for ending the data packet duplication simulation test, a test data packet damage end command, which is a command for ending the data packet damage simulation test, and a test data packet disorder end command, which is a command for ending the data packet disorder simulation test.

[0085] Specifically, if the simulation test start command includes a test network delay start command, the simulation test end command includes a test network delay end command. If the simulation test start command includes a test packet loss start command, the simulation test end command includes a test packet loss end command. If the simulation test start command includes a test data packet repeat start command, the simulation test end command includes a test data packet repeat end command. If the simulation test start command includes a test data packet damage start command, the simulation test end command includes a test data packet damage end command. If the simulation test start command includes a test data packet disorder start command, the simulation test end command includes a test data packet disorder end command.

[0086] Specifically, in the implementation of the present application, by executing the simulation test end command on the test host 100, the ability of the system to be tested 200 to process data packets per second, that is, the recovery processing capacity value, that is, the recovery TPS value, and the status information of the system to be tested 200 (as an example of the second operation information) are monitored. The recovery capability of the system to be tested 200 can be determined based on the first operation information and the second operation information.

[0087] Exemplarily, if the second operation information is consistent with the first operation information, the abnormal simulation test of the system to be tested 200 passes, and the recovery capability is to restore to normal; if the second operation information is inconsistent with the first operation information, the abnormal simulation test of the system to be tested 200 fails, and the recovery capability is to restore to abnormality.

[0088] In the implementation of the present application, the execution capability of the system to be tested 200 for network anomaly simulation and the network anomaly data processing capability of the system to be tested 200 when facing network anomalies can be observed based on the test information. And based on the first operation information and the second operation information, it can be observed whether the system to be tested 200 has the ability to recover to the original level after experiencing the network anomaly simulation. That is, whether the second operation information obtained is the same or similar to the first operation information. If they are the same or similar, it means that the system to be tested 200 has the ability to recover.

[0089] In the implementation method of the present application, by monitoring the status information of the system to be tested 200 throughout the entire process, it is possible to view the processing capability of the system to be tested 200 when experiencing a network anomaly (that is, the data processing capability of the system to be tested when facing a network anomaly state and the data processing capability before and after experiencing a network anomaly) and the performance of each host device 210 when experiencing a network anomaly and other information.

[0090] The network anomaly simulation test method provided by the implementation of the present application adopts a highly available test method, that is, an efficient and practical test method, by first obtaining the initial processing capacity value of the system to be tested 200, that is, the initial TPS value and status information, and then executing the simulation test based on the Linux operating system simulation test start command to obtain the test information. According to the test information, it can be determined whether the simulation is successful, that is, the execution capacity of the system to be tested 200 and the processing capacity of the system to be tested 200 when facing network anomalies. And after the simulation test is completed, the recovery TPS value and status information of the system to be tested after the network is restored are obtained, the initial TPS value and the recovery TPS value are compared, and the status information before the simulation test and the status information after the simulation test are compared to determine whether the system to be tested 200 has the ability to recover.

[0091] Thus, based on the test command, it is possible to intuitively analyze whether the simulation test is appropriate, and the simulation test can be performed without professional testers. The simulation test based on the Linux operating system is simple to perform based on the test command, and there is no need to install software and external equipment, thereby reducing the test cost, and there is no need to install any test software. Moreover, based on the test command simulation test, different test scenarios can be simulated, and the simulation test is diverse. Because it is an operating system test, there is no need to pass through other test equipment, and the test results do not need to be transmitted, which reduces test interference and makes the test results reliable and practical. Moreover, testing based on the operating system can be applied to a variety of test systems and test scenarios, and simulation tests are performed in advance to verify the processing capacity of the system to be tested 200, which can effectively prevent various problems that may occur in the system to be tested 200 when a network anomaly is actually encountered.

[0092] For further information, see Figure 5 In one implementation of the present application, the network anomaly simulation test method includes the following steps:

[0093] S210, obtaining a maximum processing capacity of the system to be tested and a preset pressure threshold, determining a load pressure of the system to be tested according to the maximum processing capacity and the preset pressure threshold, and operating the system to be tested according to the load pressure.

[0094] Exemplarily, according to the proportion of test transactions in the mixed test scenario, 50% (as an example of a preset pressure threshold) of the maximum processing capacity of the system to be tested 200 is used as the load pressure, and the system to be tested is operated according to the load pressure.

[0095] It should be noted that, in the implementation of the present application, the pressure generator for performing the pressure test is used to apply pressure to the system to be tested 200. In the implementation of the present application, the pressure generator can be a pressure device for performing the pressure test in the prior art. The present application embodiment does not explain the pressure generator. Those skilled in the art only need to implement the pressure control of the system to be tested 200 when performing the network abnormality simulation.

[0096] It should also be noted that in the implementation of the present application, the preset pressure threshold range can be 40% to 70%, such as 40%, 45%, 50%, 60%, 70%. Those skilled in the art can set it according to actual needs, and this embodiment is only described by taking 50% as an example.

[0097] S220, after operating the system to be tested for a first time according to the load pressure, obtaining first operating information of the system to be tested.

[0098] Exemplarily, under a steady load pressure, and after the system to be tested 200 runs stably for 10 minutes (as an example of the first time), the first operation information of the system to be tested 200 in a stable operation state is obtained.

[0099] It should be noted that, in the implementation of the present application, the first time range can be 8 minutes to 20 minutes, for example, 8 minutes, 10 minutes, 12 minutes, 15 minutes, 20 minutes. Those skilled in the art can select the running time according to actual needs. In this embodiment, 10 minutes is taken as an example as the stable running time.

[0100] S230, receiving a simulation test start operation from a user to determine a simulation test start command.

[0101] Exemplarily, the user, i.e., the tester, enters a simulation test start command in the Linux operating system, such as a test network delay start command, a test packet loss start command, a test data packet duplication start command, a test data packet damage start command, and a test data packet disorder start command, etc. Based on the simulation test start command run by the tester, the corresponding abnormal simulation test is started.

[0102] S240, after performing the simulation test on the system to be tested for a second time according to the simulation test start command, obtaining test information of the system to be tested.

[0103] Exemplarily, the test host 100 controls the output network card of the router to perform corresponding network abnormality operations according to the simulation test start instruction, and continues to perform network abnormality simulation for 10 minutes (as an example of the second time), such as a network delay of 10 minutes, etc. The test host 100 continues to obtain test information of the system to be tested 200 during these 10 minutes.

[0104] It should be noted that, in the implementation of the present application, the second time range is 8 minutes to 20 minutes, for example, 8 minutes, 10 minutes, 12 minutes, 15 minutes, and 20 minutes. Those skilled in the art can select the running time according to actual needs. In this embodiment, 10 minutes is taken as an example as the simulation test running time.

[0105] Furthermore, the test host obtains the test data and status information of the system to be tested 200 .

[0106] Specifically, if the simulation test start command is a test network delay start command, the test data includes a data packet delay rate and a transaction log when performing a network delay simulation test. That is, if the network anomaly simulation is a network delay, the data packet delay rate is calculated to determine whether the simulation test start command is transmitted to the router, and whether the simulation test is successful, that is, to determine the execution capability of the system to be tested 200. If the simulation test start command is a test packet loss start command or a test packet duplication start command or a test packet damage start command or a test packet disorder start command, the test data includes a data packet error rate and a transaction log when performing a network packet loss or data packet duplication or data packet damage or data packet disorder simulation test, that is, the data packet error rate is calculated to determine whether the simulation test start command is transmitted to the router, and whether the simulation test is successful.

[0107] Furthermore, the implementation method of the present application records a test log, also known as a transaction log, during the simulation test process, which is used to record changes in data packets during the test process, as well as the processing capabilities and status changes of the system to be tested during the simulation test process, etc., so that testers can view the response status of the system to be tested under abnormal network conditions and the entire process of the simulation test.

[0108] S250, receiving a simulation test end operation from the user to determine a simulation test end command.

[0109] Exemplarily, the user, i.e., the tester, enters a simulation test end command in the Linux operating system, such as a test network delay end command, a test packet loss end command, a test data packet duplication end command, a test data packet damage end command, and a test data packet disorder end command, etc. Based on the simulation test end command entered by the tester, the corresponding abnormal simulation test is exited.

[0110] S260: Acquire second operation information of the system to be tested after the system to be tested executes the simulation test end instruction for a third time.

[0111] Exemplarily, the test host 100 controls the output network card of the router to exit the corresponding network abnormal operation according to the simulation test end instruction, and continues to execute in the network recovery mode for 10 minutes (as an example of the third time). The test host 100 continues to obtain the recovery processing capacity value of the system to be tested 200 after 10 minutes, for example, at the 11th minute, and the status information of the system to be tested 200 after recovery.

[0112] It should be noted that, in the implementation of the present application, the third time range is 8 minutes to 20 minutes, for example, 8 minutes, 10 minutes, 12 minutes, 15 minutes, and 20 minutes. Those skilled in the art can select the running time according to actual needs. In this embodiment, 10 minutes is taken as the recovery running time.

[0113] S270, determining the execution capability of the system to be tested to execute the abnormal simulation test according to the test information and the expected test result.

[0114] Exemplarily, the test host 100 determines the execution capability of the system to be tested 200 according to the test data obtained in the abnormal simulation test phase and the information in the simulation test start command (ie, the expected test result).

[0115] Among them, if the test information is consistent with the expected test result, it is determined that the execution capability of the system to be tested for the abnormal simulation test is executed, and the user determines the processing capability of the system to be tested according to the test information, and if the test information is inconsistent with the expected test result, it is determined that the execution capability of the system to be tested for the abnormal simulation test is not executed. Specifically, if the simulation test start command is a test network delay start command, the data packet delay rate is calculated to determine whether the simulation test start command is transmitted to the router, and the execution status of the system to be tested 200 during the simulation test. If the simulation test start command is a test packet loss start command or a test data packet duplication start command or a test data packet damage start command or a test data packet disorder start command, the data packet abnormal state is the data packet error rate, that is, the data packet error rate is calculated to determine whether the simulation test start command is transmitted to the router, and the execution status of the system to be tested 200 during the simulation test.

[0116] Furthermore, the network abnormality data processing capability of the system to be tested when facing a network abnormality during the simulation test process is determined according to the status information of the system to be tested.

[0117] Furthermore, the implementation method of the present application records the test log, that is, the transaction log, for the tester to view the changes in the data packets during the test process and the state changes of the system to be tested during the simulation test process.

[0118] S280: Determine the recovery capability of the system to be tested for exiting the abnormal simulation test according to the first operation information and the second operation information.

[0119] Exemplarily, if it is determined that the second operating information is the same as the first operating information, it is determined that the abnormal simulation test of the system to be tested 200 has passed, and the recovery capability is to restore to normal; if it is determined that the second operating information is not the same as the first operating information, it is determined that the abnormal simulation test of the system to be tested 200 has failed, and the recovery capability is to restore to abnormality.

[0120] That is, according to the first operation information and the second operation information, it can be observed whether the system to be tested 200 has the ability to recover to the original level after experiencing the network abnormality simulation. That is, whether the second operation information obtained is the same or similar to the first operation information. If they are the same or similar, it means that the recovery ability of the system to be tested 200 is normal, otherwise the recovery ability of the system to be tested is abnormal, that is, the abnormal simulation test fails.

[0121] The first operation information includes the initial processing capability value of the system to be tested and the status information of the system to be tested. The second operation information includes the recovery processing capability value of the system to be tested and the status information of the system to be tested.

[0122] That is, in the implementation of the present application, the test host 100 monitors the status information of the test server 210, and determines whether the test server 210 can reach the required processing capacity when facing network delay according to the status information of the test server 210. In addition, each host device 220 also monitors and displays the test information and status capabilities of its own device, so that the tester can determine whether each host device can meet the requirements according to the test information and status capabilities of each host device 220.

[0123] Furthermore, in the implementation of the present application, the first operation information and the second operation information also include transaction logs, that is, the implementation of the present application records the entire process of the network anomaly simulation test in a log so that the tester can analyze the performance of the system to be tested before and after the network anomaly simulation based on the transaction logs.

[0124] Further, see Figure 6 The network anomaly simulation test method provided by the implementation of this application further performs the following steps:

[0125] S310, applying pressure to the system under test using a preset pressure threshold percentage of the maximum processing capacity of the system under test as load pressure, running the scenario stably for a first time, and obtaining first operation information after the system under test runs under the load pressure for the first time.

[0126] Exemplarily, according to the proportion of test transactions in the mixed test scenario, 50% of the maximum processing capacity of the system to be tested 200 is used as the load pressure, and the system to be tested 200 is operated according to the load pressure. The scenario is stably operated for 10 minutes, and the initial processing capacity value and status information of the system to be tested 200 are obtained during this period or after 10 minutes.

[0127] S320, executing corresponding abnormal simulation tests on all compressors according to the simulation test start command, and obtaining test information of the system to be tested under the simulation test.

[0128] Exemplarily, if a network delay simulation test is performed, the test host 100 executes the test network delay start command on all transmitters according to the test network delay start command. For example, the data packet is delayed by about 100 milliseconds (ms) to be sent, and the test host 100 detects whether the time when the system to be tested 200 receives the data packet is delayed by 100 milliseconds. In addition, the test host 100 also obtains transaction logs and status information to monitor whether the system to be tested 200 has performed network abnormality simulation operations during the network abnormality simulation process, and whether the system to be tested 200 meets the expected test results in the network abnormality state.

[0129] For example, taking the start command for testing network delay as "***add***eth0***delay 100ms 10ms" as an example, through this command, the transmission of the network card eth0 can be set to 100ms plus or minus 10ms, that is, any delay value between 90ms and 110ms is sent.

[0130] Furthermore, if a network packet loss simulation test is performed, the test host 100 executes the test network packet loss start command on all transmitters according to the test network packet loss start command. For example, if the packet error rate reaches about 10%, the test host 100 detects that the packet error rate of the system to be tested 200 reaches about 10%. In addition, the test host 100 also obtains transaction logs and status information to monitor whether the system to be tested 200 has performed the network abnormality simulation operation during the network abnormality simulation process, and whether the system to be tested 200 meets the expected test results in the network abnormality state.

[0131] For example, take the test network packet loss start command as "***add***eth0***loss 1%" as an example, through this command, the network card transmission can be set to randomly lose 1% of the data packets. Or take "***add***eth0***loss10%" as an example, through this command, the network card transmission can be set to randomly lose 10% of the data packets. Or take "***add***eth0***loss 1%30%" as an example, this command sets the network card transmission to randomly lose 1% of the data packets, with a success rate of 30%.

[0132] Furthermore, if a packet repetition simulation test is performed, the test host 100 executes a test packet repetition start command on all transmitters according to the test packet repetition start command. For example, if the packet error rate reaches about 10%, the test host 100 detects that the packet error rate of the system to be tested 200 reaches about 10%. In addition, the test host 100 also obtains transaction logs and status information to monitor whether the system to be tested 200 has performed a network abnormality simulation operation during the network abnormality simulation process, and whether the system to be tested 200 meets the expected test results in the network abnormality state.

[0133] For example, taking the test data packet duplication start command "***add***eth0***duplicate 1%" as an example, this command can be used to set the transmission of the network card to randomly generate 1% duplicate data packets.

[0134] Furthermore, if a data packet damage simulation test is performed, the test host 100 executes a test data packet damage start command on all transmitters according to the test data packet damage start command. For example, if the data packet error rate reaches about 10%, the test host 100 detects that the data packet error rate of the system to be tested 200 reaches about 10%. In addition, the test host 100 also obtains transaction logs and status information to monitor whether the system to be tested 200 has performed a network abnormality simulation operation during the network abnormality simulation process, and whether the system to be tested 200 meets the expected test results in the network abnormality state.

[0135] For example, taking the test packet corruption start command "***add***eth0***corrupt 0.2%" as an example, the packet corruption start command sets the transmission of the network card to randomly generate 0.2% corrupted packets.

[0136] Furthermore, if a packet disorder simulation test is performed, the test host 100 executes the test packet disorder start command on all transmitters according to the test packet disorder start command. For example, if the packet error rate reaches about 10%, the test host 100 detects that the packet error rate of the system to be tested 200 reaches about 10%. In addition, the test host 100 also obtains transaction logs and status information to monitor whether the system to be tested 200 has performed the network abnormality simulation operation during the network abnormality simulation process, and whether the system to be tested 200 meets the expected test results in the network abnormality state.

[0137] For example, the command to test the disorder of data packets is "***change***eth0***delay 10ms reorder25%50%". Through this command, the transmission of the network card can be set to have 25% to 50% of the data packets be sent immediately, and the others are delayed for 10 seconds. Or take "***add***eth0***delay 100ms 10ms" as an example, through this command, the transmission of the network card can be set to randomly delay the data packets from 90ms to 110ms.

[0138] S330, monitoring test information of the system to be tested, and determining execution capability of the system to be tested according to the test information.

[0139] For example, in the network anomaly simulation test, observe each transaction error rate or transaction delay rate, processing capacity, response time and each host resource situation. That is, the test host 100 monitors whether all relevant transaction response times of the system to be tested 200 meet the expected test results (that is, transaction error rate, transaction error rate or transaction delay rate), whether the total TPS value is reduced (that is, processing capacity), whether the application CPU is less than or equal to 60%, and whether the database CPU is less than or equal to 80% (that is, the resource situation of each host). Therefore, the above information is used to determine whether the system to be tested 200 is in a network delay scenario.

[0140] In the implementation of this application, the "***show dev eth0" command is used to view and display the relevant transmission configuration of the eth0 network card.

[0141] Furthermore, in the implementation of the present application, the test host 100 also monitors other status data of the system to be tested, so as to obtain the response capability, that is, the processing capability, of the system to be tested 200 under the network delay state.

[0142] S340, controlling the router to exit the corresponding simulation test according to the simulation test end command, and obtaining second operation information of the system to be tested when exiting the abnormal simulation test.

[0143] Exemplarily, by executing a simulation test end command on the test host 100 , the recovery processing capability value of the system to be tested and the status information of the system to be tested are monitored.

[0144] Specifically, the simulation test start command "add" is changed to the deletion command "del" to generate the simulation test end command. For example, "***del***" will delete the relevant transmission configuration of the eth0 network card.

[0145] S350, analyzing and recording the test result data (ie, the first operation information and the second operation information).

[0146] Exemplarily, the time nodes are monitored in real time, and a test report is generated according to the time nodes and the corresponding first operation information, test information, and second operation information.

[0147] Specifically, the time nodes include the time point of stable operation for the first time, the time point of executing the simulation test start command, the time point of executing the simulation test start command for the second time, the time point of executing the simulation test end command, and the time point of executing the simulation test end command for the third time. By monitoring and recording the switching time, examining the node switching time and the transaction delay rate or transaction error rate, it is convenient for testers to view the entire test process.

[0148] Furthermore, the first operation information before the simulation test, i.e., the initial processing capacity value and the status information of the initial state, is monitored in real time; the test information during the simulation test, i.e., the transaction delay rate or transaction error rate and the transaction log and the status information during the test, is monitored in real time; the second operation information after the simulation test, i.e., the recovery processing capacity value and the status information of the recovery state, is monitored in real time. This information is recorded to generate a test report, so that the tester can check the state changes and performance changes of the system 200 to be tested during the entire test cycle. For example, after the network delay command is canceled, i.e., after the test network delay end command is executed, i.e., within the 11th minute, check whether the transaction, i.e., the response time of the data packet and the total processing capacity value, i.e., the TPS value, have returned to normal values ​​and reached the original level (i.e., whether it has been restored to the value of the first operation information). Check whether the transaction, i.e. the response time of the data packet and the total processing capacity value, i.e. the TPS value, have returned to normal values ​​and reached the original levels within the 11th minute after the network delay command is canceled, i.e. the test packet loss end command, the test data packet duplication end command, the test data packet damage end command, and the test data packet disorder end command are executed for a third time (for example, 10 minutes). Check whether the transaction, i.e. the response time of the data packet and the total processing capacity value, i.e. the TPS value, have returned to normal values ​​and reached the original levels, and whether there are no errors in the transaction (i.e. whether they have returned to the values ​​of the first operation information).

[0149] That is, in the implementation method of the present application, by acquiring test data, it is possible to monitor whether the response time of all relevant transactions is extended by about 100 milliseconds during the network delay simulation test, whether errors occur in all relevant transactions during the network packet loss simulation test, the data packet duplication simulation test, the data packet damage simulation test, and the data packet disorder simulation test, whether the error rate is about 10%, and whether the total TPS value is reduced, so as to verify whether the system to be tested experiences network anomalies during the simulation test and determine the execution capability of the system to be tested 200 under the network abnormality state.

[0150] Furthermore, the implementation method of the present application verifies whether the system 200 to be tested has returned to normal by checking the second operation information after executing the test network delay end command / test packet loss end command / test data packet duplication end command / test data packet damage end command / test data packet disorder end command.

[0151] Furthermore, in the implementation of the present application, the transaction log can enable the tester to monitor the test process in real time.

[0152] Furthermore, in the implementation of the present application, the status and performance of the system to be tested 200 during the network abnormality process can be monitored in real time by monitoring the host CPU utilization, memory occupancy, IO busyness, application service process, middleware, i.e., message queue, and database operation of the test server 210 and each host device 220. This facilitates the tester to monitor the system's ability to respond to network abnormalities based on the above information.

[0153] It should be noted that, in the implementation of the present application, the Linux operating system is taken as an example to illustrate the specific execution process of the network anomaly simulation method. Those skilled in the art can also implement the network anomaly simulation method through the Windows operating system.

[0154] It should also be noted that the network anomaly simulation test method provided by the implementation of the present application is used in the network anomaly simulation non-functional test of the banking system. Of course, it can also be used in other data information systems to implement network anomaly simulation testing.

[0155] Further, see Figure 7 , Figure 7 This is a schematic diagram of the structure of the network anomaly simulation test device provided in the embodiment of the present application. Figure 7 As shown, the network anomaly simulation test device includes: a first acquisition module 701, a first processing module 702 and a second processing module 703.

[0156] The first acquisition module 701 is used to acquire first operation information of the system to be tested.

[0157] The first processing module 702 is used to determine a simulation test start command, perform an abnormal simulation test on the system to be tested according to the simulation test start command, obtain and display test information of the system to be tested, so that the user can determine the execution capability of the system to be tested for the abnormal simulation test according to the test information and the expected test results, wherein, if the test information and the expected test results are inconsistent, the execution capability of the system to be tested for the abnormal simulation test is determined to be not executed; if the test information and the expected test results are consistent, the execution capability of the system to be tested for the abnormal simulation test is determined to be executed, and the user can determine the processing capability of the system to be tested according to the test information.

[0158] The second processing module 703 is used to determine the simulation test end command, and obtain the second operation information of the system to be tested according to the simulation test end command, so that the user can determine the recovery capability of the system to be tested according to the first operation information and the second operation information, wherein, if the second operation information is the same as the first operation information, the abnormal simulation test of the system to be tested passes, and the recovery capability is to return to normal; if the second operation information is different from the first operation information, the abnormal simulation test of the system to be tested fails, and the recovery capability is to recover to abnormality.

[0159] The network anomaly simulation test device provided in the embodiment of the present application can be used to execute the network anomaly simulation test method described in the above embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0160] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the processing module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0161] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device may include: a transceiver 121 , a processor 122 , and a memory 123 .

[0162] The processor 122 executes the computer execution instructions stored in the memory, so that the processor 122 executes the scheme in the above embodiment. The processor 122 can be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0163] The memory 123 is connected to the processor 122 via a system bus and completes communication between them. The memory 123 is used to store computer program instructions.

[0164] By way of example and not limitation, the memory 123 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 123 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 123 may be inside or outside the integrated gateway device. In a particular embodiment, the memory 123 is a non-volatile solid-state memory. In a particular embodiment, the memory 123 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of these.

[0165] The transceiver 121 may be used to obtain tasks to be executed and configuration information of the tasks to be executed.

[0166] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.

[0167] The electronic device provided in the embodiment of the present application may be the terminal device of the above embodiment.

[0168] An embodiment of the present application also provides a chip for running instructions, which is used to execute the technical solution of the network anomaly simulation test method in the above embodiment.

[0169] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the network anomaly simulation test method of the above embodiment.

[0170] In some possible implementations, various aspects of the method provided in the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the method according to various exemplary implementations of the present application described above in this specification. For example, the computer device can execute the network anomaly simulation test method recorded in the embodiments of the present application.

[0171] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0172] The implementation method of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the network anomaly simulation test method in the above embodiment.

[0173] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable information processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable information processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0174] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable information processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0175] These computer program instructions can also be loaded onto a computer or other programmable information processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0176] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.

[0177] It should be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.

Claims

1. A network anomaly simulation test method, characterized in that: An operating system applied to an electronic device, the method comprising: Acquire first operation information of the system to be tested; Determine a simulation test start command, perform an abnormal simulation test on the system to be tested according to the simulation test start command, obtain and display test information of the system to be tested, so that the user can determine the execution capability of the system to be tested to perform the abnormal simulation test according to the test information and the expected test result, wherein, if the test information is inconsistent with the expected test result, the execution capability of the system to be tested to perform the abnormal simulation test is determined to be not executed, and if the test information is consistent with the expected test result, the execution capability of the system to be tested to perform the abnormal simulation test is determined to be executed, and the user can determine the processing capability of the system to be tested according to the test information; Determine a simulation test end command, and obtain second operating information of the system to be tested according to the simulation test end command, so that the user can determine the recovery capability of the system to be tested based on the first operating information and the second operating information, wherein if the second operating information is consistent with the first operating information, the abnormal simulation test of the system to be tested passes, and the recovery capability is recovery to normal; if the second operating information is inconsistent with the first operating information, the abnormal simulation test of the system to be tested fails, and the recovery capability is recovery to abnormality.

2. The network anomaly simulation test method according to claim 1, characterized in that: Obtaining first operation information of the system to be tested, including: Obtaining the maximum processing capacity and preset pressure threshold of the system to be tested; Determining the load pressure of the system to be tested according to the maximum processing capacity and the preset pressure threshold; After the system to be tested is operated according to the load pressure, the first operation information of the system to be tested is obtained.

3. The network anomaly simulation test method according to claim 2, characterized in that: The method further comprises: Real-time monitoring of time nodes; A test report is generated according to the time node, and the first operation information, the test information, and the second operation information corresponding to the time node.

4. The network anomaly simulation test method according to claim 2 or 3, characterized in that: The first operation information includes an initial processing capability value of the system to be tested and status information of the system to be tested; The test information includes test data of the system to be tested and status information of the system to be tested; The second operation information includes the recovery processing capability value of the system to be tested and the status information of the system to be tested.

5. The network anomaly simulation test method according to any one of claims 2 to 4, characterized in that: After running the system to be tested according to the load pressure, obtaining the first operation information of the system to be tested includes: After the system to be tested is operated for a first time according to the load pressure, the first operation information of the system to be tested is acquired.

6. The network anomaly simulation test method according to any one of claims 1 to 5, characterized in that: Determining a simulation test start command includes: receiving a simulation test start operation from a user to determine the simulation test start command; Determining a simulation test end command includes: receiving a simulation test end operation from a user to determine the simulation test end command.

7. The network anomaly simulation test method according to any one of claims 1 to 6, characterized in that: Performing an abnormal simulation test on the system to be tested according to the simulation test start command, and acquiring and displaying test information of the system to be tested, including: After performing the abnormal simulation test on the system to be tested for a second time according to the simulation test start command, the test information of the system to be tested is acquired and displayed.

8. The network anomaly simulation test method according to any one of claims 1 to 7, characterized in that: Acquiring second operation information of the system to be tested according to the simulation test end command includes: After the system to be tested executes the simulation test end command for a third time, second operation information of the system to be tested is obtained.

9. The network anomaly simulation test method according to claim 4, characterized in that: The status information includes CPU utilization, memory occupancy, system disk busyness, application service processes, message queues, and database operation status.

10. The network anomaly simulation test method according to any one of claims 1 to 9, characterized in that: If the simulation test start command includes a test network delay start command, then the simulation test end command includes a test network delay end command; If the simulation test start command includes a test packet loss start command, then the simulation test end command includes a test packet loss end command; If the simulation test start command includes a test data packet repeat start command, the simulation test end command includes a test data packet repeat end command; If the simulation test start command includes a test data packet damage start command, the simulation test end command includes a test data packet damage end command; If the simulation test start command includes a test data packet disorder start command, the simulation test end command includes a test data packet disorder end command.

11. The network anomaly simulation test method according to claim 4, characterized in that: If the simulation test start command is a test network delay start command, the test data of the system to be tested includes a data packet delay rate and a transaction log; If the simulation test start command is any one of a test packet loss start command, a test data packet duplication start command, a test data packet damage start command, and a test data packet disorder start command, the test data of the system to be tested includes a data packet error rate and the transaction log.

12. The network anomaly simulation test method according to any one of claims 1 to 11, characterized in that: The expected test result is determined according to the simulation test start command.

13. A network anomaly simulation test device, characterized in that: include: A first acquisition module, used to acquire first operation information of the system to be tested; A first processing module is used to determine a simulation test start command, perform an abnormal simulation test on the system to be tested according to the simulation test start command, and obtain and display test information of the system to be tested, so that a user can determine the execution capability of the system to be tested to perform the abnormal simulation test according to the test information and the expected test result, wherein if the test information and the expected test result are inconsistent, the execution capability of the system to be tested to perform the abnormal simulation test is determined to be not executed, and if the test information and the expected test result are consistent, the execution capability of the system to be tested to perform the abnormal simulation test is determined to be executed, and the user can determine the processing capability of the system to be tested according to the test information; The second processing module is used to determine the simulation test end command, and obtain the second operating information of the system to be tested according to the simulation test end command, so that the user can determine the recovery capability of the system to be tested according to the first operating information and the second operating information, wherein if the second operating information is consistent with the first operating information, the abnormal simulation test of the system to be tested passes, and the recovery capability is to recover to normal; if the second operating information is inconsistent with the first operating information, the abnormal simulation test of the system to be tested fails, and the recovery capability is to recover to abnormality.

14. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the network anomaly simulation test method as described in any one of claims 1-12.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the network anomaly simulation test method as described in any one of claims 1-12.

16. A computer program product, characterized in that It includes a computer program, which, when executed by a processor, implements the network anomaly simulation test method described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Voice test method for simulating packet loss, delay and jitter under IMS (internet protocol multimedia subsystem) large network environment

    CN102611590A

  • Method and device for testing network anomaly, computer device, and readable medium

    CN109495336A