System testing method and device, computer equipment, storage medium and program product
Through a system testing method based on failure mode and root cause construction in a virtual environment, the problem of low fidelity in the simulation environment in the prior art is solved, and the accuracy of fault injection and system testing is improved.
Patent Information
- Application Number
- CN202410781960.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-12-17
AI Technical Summary
In the existing fault injection methods, the low fidelity of the simulation environment leads to insufficient fault injection accuracy and system test accuracy, and the actual fault conditions cannot be fully evaluated.
By determining the failure mode and root cause corresponding to the fault injection elements, a virtual environment that accurately reflects the actual system architecture, and performs fault injection in the virtual environment to obtain response data to generate fault test results.
It improves the accuracy of fault injection and the accuracy of system testing, and ensures the authenticity and dynamicity of the fault test results of the test system.
Smart Images

Figure CN119149386A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and specifically to a system testing method, apparatus, computer equipment, storage medium, and program product, wherein the storage medium is a computer-readable storage medium, and the program product is a computer program product. Background Art
[0002] In order to evaluate the software quality of the system, fault injection testing can be used to simulate fault conditions, and then the quality analysis of the system software can be performed based on the simulation results.
[0003] Currently, existing fault injection methods generally involve simply constructing a simulation environment, injecting faults into it, and using the simulation environment to simulate the occurrence of faults. However, this approach reduces the fidelity of the fault injection process, resulting in a significant gap between the simulation environment and the actual operating environment. This leads to inadequate evaluation of the system under actual fault conditions, reducing the accuracy of fault injection and, consequently, the accuracy of system simulation testing. Summary of the Invention
[0004] The embodiments of the present application provide a system testing method, apparatus, computer equipment, storage medium, and program product, which can improve the accuracy of fault injection, thereby improving the accuracy of system testing.
[0005] To solve the above technical problems, the embodiments of the present application provide the following technical solutions:
[0006] The present invention provides a system testing method, including:
[0007] Determine the failure mode corresponding to the fault injection element;
[0008] Determining a root cause of a fault based on the fault mode and the fault injection factor;
[0009] Building a virtual environment according to the fault root cause and the fault injection elements, and performing fault injection in the virtual environment;
[0010] Response data to the fault injection in the virtual environment is acquired, and a fault test result of the system to be tested is generated according to the response data.
[0011] According to one aspect of the present application, a system testing device is also provided, comprising:
[0012] A mode determination module, used to determine the fault mode corresponding to the fault injection element;
[0013] A root cause determination module, configured to determine a root cause of a fault based on the fault mode and the fault injection factor;
[0014] A fault injection module, configured to construct a virtual environment according to the fault root cause and the fault injection elements, and perform fault injection in the virtual environment;
[0015] The result generating module is used to obtain response data to the fault injection in the virtual environment and generate a fault test result of the system to be tested according to the response data.
[0016] According to one aspect of the present application, a computer device is also provided, including a processor and a memory, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, any system testing method provided in the embodiments of the present application is executed.
[0017] According to one aspect of the present application, a storage medium is further provided, wherein the storage medium is used to store a computer program, and the computer program is loaded by a processor to execute any one of the system testing methods provided in the embodiments of the present application.
[0018] According to one aspect of the present application, a computer program product is also provided, including a computer program, which is loaded by a processor to execute any one of the system testing methods provided in the embodiments of the present application.
[0019] The present application can determine the fault mode corresponding to the fault injection element, determine the root cause of the fault based on the fault mode and the fault injection element, and increase the accuracy of the fault root cause matching based on the fault mode. Then, a virtual environment can be constructed based on the fault root cause and the fault injection element. Through the fault root cause, a virtual environment that accurately reflects the actual system architecture can be constructed, and fault injection can be performed in the virtual environment to simulate the actual fault realistically and dynamically, thereby improving the accuracy of fault injection. Finally, the response data for the fault injection in the virtual environment is obtained, and the fault test results of the system to be tested are generated based on the response data. Based on the accurately constructed virtual environment, the actual fault is realistically and dynamically simulated to implement fault testing of the system to be tested, thereby improving the accuracy of system testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 This is a schematic diagram of a scenario in which the system testing method provided in an embodiment of the present application is applied;
[0022] Figure 2 Schematic diagram of the system testing method provided in the embodiment of the present application;
[0023] Figure 3 is a schematic diagram of an information input interface provided in an embodiment of the present application;
[0024] Figure 4 is another schematic diagram of the information input interface provided in an embodiment of the present application;
[0025] Figure 5 is another schematic diagram of the information input interface provided in an embodiment of the present application;
[0026] Figure 6 This is another flowchart of the system testing method provided in an embodiment of the present application;
[0027] Figure 7 This is another flowchart of the system testing method provided in an embodiment of the present application;
[0028] Figure 8 Schematic diagram of the server architecture of the system testing method provided in the embodiment of the present application;
[0029] Figure 9 This is an interactive diagram of the system testing method provided in an embodiment of the present application;
[0030] Figure 10 is a schematic diagram of a system testing device provided in an embodiment of the present application;
[0031] Figure 11 It is a structural diagram of the computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0033] In the following description of this application, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
[0034] In the following description of this application, the terms "first\second" and the like are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that "first\second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0035] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0036] In order to better understand the embodiments of the present application, a system testing method, apparatus, computer equipment, storage medium and program product are provided. The application environment applicable to the embodiments of the present application is described below.
[0037] See also Figure 1 , Figure 1 The following is a schematic diagram showing an application environment of the system testing method provided by an embodiment of the present application. As an implementation method, the methods of obtaining fault description information, determining fault mode, determining the root cause of fault, and fault injection provided by the embodiment of the present application can be applied to the same computer device. The computer device can be Figure 1 The server 10 shown in FIG. 1 can be connected to the terminal device 20 via a network. The network is a medium for providing a communication link between the server 10 and the terminal device 20. The network can include various connection types, such as wired communication links, wireless communication links, etc., which are not limited in the present embodiment. Alternatively, in other embodiments, the computer device can also be a smartphone, a computer, etc.
[0038] It should be understood that Figure 1 The server 10, network and terminal device 20 are merely schematic. Depending on the implementation needs, there can be any number of servers, networks and terminal devices. For example, the server 10 can be a physical server, or a server cluster or distributed system composed of multiple servers, etc. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms, but is not limited to this. The terminal device 20 can be a mobile phone, a computer, an intelligent voice interaction device, a smart home appliance, and a car terminal. It will be understood that the embodiments of the present application can also allow multiple terminal devices 20 to access the server 10 at the same time.
[0039] In some embodiments, the terminal device 20 can receive fault description information input by the user through the information input interface. Furthermore, the terminal device 20 sends the fault description information to the server 10 via the network. After the server 10 receives the fault description information, it can construct a virtual environment based on the fault description information and perform fault injection to test the system using the system testing method described in the embodiments of the present application.
[0040] As another embodiment, the methods for obtaining fault description information, determining fault modes, determining root causes of faults, and fault injection provided in the embodiments of the present application can be applied to different computer devices. For example, the method for obtaining fault description information is applied to computer device A, the method for determining fault modes is applied to computer device B, the method for determining root causes of faults is applied to computer device C, and the system testing method is applied to computer device D, etc. In addition, any combination of the methods for obtaining fault description information, determining fault modes, determining root causes of faults, and fault injection provided in the embodiments of the present application can be applied to the same computer device. For example, the methods for obtaining fault description information, determining fault modes, and the like are applied to computer device A, the methods for determining root causes of faults, and fault injection, and the like are applied to computer device B, and so on. The embodiments of the present application do not limit the computer devices to which the above three methods are applied.
[0041] It should be noted that Figure 1 The application environment diagram of the system testing method shown is only an example. The application and scenario of the system testing method described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided by the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of the application of the system testing method and the emergence of new business scenarios, the technical solution provided by the embodiment of the present application is also applicable to similar technical problems.
[0042] In the existing fault injection method, the fidelity of the constructed simulation environment is low, the fault injection accuracy is low, and the accuracy of the system test is low. In order to solve this technical problem, the present application determines the fault mode based on the fault injection elements, and accurately determines the root cause of the fault based on the fault mode and the fault injection elements. Then, based on the root cause of the fault, a virtual environment that accurately reflects the actual system architecture is constructed to perform fault injection. By realistically and dynamically simulating actual faults, response data is obtained to generate fault test results for the system to be tested, thereby improving the accuracy of fault injection and thus improving the accuracy of system testing.
[0043] It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.
[0044] In this embodiment, the system testing device will be described from the perspective of the system testing device, which can be integrated into computer equipment such as a server.
[0045] See also Figure 2 , Figure 2 : is a flow chart of a system testing method provided in one embodiment of the present application. The system testing method may include:
[0046] S101. Determine a fault mode corresponding to a fault injection element.
[0047] During the testing of the system under test, the failure mode of the fault injection element corresponding to the system under test can be determined first. The system under test may include a system integrating hardware, network, operating system, and application objects. The hardware may include memory, hard disk, central processing unit (CPU), and graphics processing unit (GPU). The operating system may include Windows and Linux. The application objects may include web applications, middleware Redis, and database MySQL.
[0048] To accurately determine the failure mode, we can extract the fault injection elements from the fault description information of the system under test and determine the corresponding failure mode. The fault description information can be information describing the fault, such as a fault word, a sentence describing the fault, or a failure case, etc., without limitation here.
[0049] Specifically, the fault description information of the system to be tested can be obtained first, and the method of obtaining the fault description information may include: randomly selecting fault description information from a database for storing fault description information; or, obtaining corresponding fault description information from a database for storing fault description information based on a fault identifier; or, sending an information acquisition request to an information storage server, and receiving the fault description information returned by the information storage server in response to the information acquisition request; or, receiving the fault description information sent by the terminal device; or, receiving the fault description information input by the user through a pre-set information input interface; and so on. Of course, the fault description information can also be obtained in other ways, which are not limited here.
[0050] In order to improve the convenience and flexibility of obtaining fault description information, the original fault description information can be received through the information input interface first, and then the original fault description information is preprocessed to obtain the required fault description information. In some embodiments, obtaining the fault description information of the system to be tested can include:
[0051] Receive original fault description information input by the user through the information input interface;
[0052] The original fault description information is preprocessed to obtain the fault description information.
[0053] The specific interface type, interface display format, and location of the information input interface can be flexibly configured based on actual needs and are not limited here. For example, the information input interface can be configured on a terminal device. In this case, the terminal device can receive the original fault description information input by the user through the information input interface after receiving the original fault description information input by the user through the information input interface. For another example, the information input interface can be configured on a server integrated with a system testing device. The server can be provided with an interface that displays the information input interface. In this case, the terminal device can receive the original fault description information input by the user through the information input interface.
[0054] For example, Figure 3 As shown, the information input interface may be an information input interface provided with a text box, which may receive original fault description information input by the user in the text box.
[0055] For example, Figure 4 As shown, the information input interface can be an information input interface provided with a drop-down menu for selecting fault information, or multiple drop-down menus for selecting different information types (such as fault type, fault mode, and operating system, etc.), which can receive the original fault description information selected by the user in the drop-down menu displayed by triggering the selection button.
[0056] For example, Figure 5 As shown, the information input interface can be an information input interface provided with a dialog box for information interaction, which can receive the fault information or problem required to be expressed input by the user in the dialog box, and output feedback reply information after analyzing the fault information or problem input by the user, which is used to prompt the user to adjust the input or reply to the user's question. After one or more interactions, the original fault description information can be generated based on the interactive information.
[0057] After obtaining the original fault description information, the original fault description information can be pre-processed by performing text regularization and verifying the legitimacy of the information to obtain the pre-processed fault description information. Of course, the integrity and logical coherence of the original fault description information can also be verified, which is not limited here. At this time, the fault description information can be generated based on the pre-processed fault description information. For example, the original fault description information can be first subjected to text regularization, and the legitimacy of the fault description information after text regularization can be verified. If the legitimacy verification fails, the original fault description information is removed. If the legitimacy verification passes, the original fault description information is used as the fault description information. Alternatively, the original fault description information can be converted into a preset data format (such as JSON format or other format), and the converted fault description information is packaged into the fault description information. The pre-processing method of the original fault description information can also include other methods, which are not limited here.
[0058] After obtaining the fault description information, the fault injection elements can be extracted from the fault description information, and the fault mode corresponding to the fault injection elements can be determined.
[0059] Fault injection elements can include user-defined fault information, fault scope, and fault severity. The fault scope can include component scope and application layer scope, while the fault severity can include network latency and call failure rate, such as 20% call failure. Failure modes can refer to the manifestation of the fault at the service level, such as abnormal source data fetching, server downtime, and database unresponsiveness.
[0060] In some implementations, extracting fault injection elements from fault description information may include:
[0061] Extract fault injection elements from fault description information through element extraction model;
[0062] Alternatively, the fault description information is parsed to obtain parsed fault information, and the fault injection elements are extracted from the parsed fault information.
[0063] For example, a trained feature extraction model can be used to perform feature extraction operations on the fault description information to obtain fault injection features. Extracting fault injection features through the model can improve the efficiency and accuracy of fault injection feature extraction. The specific model structure and model type of the feature extraction model can be flexibly set according to actual needs and are not limited here.
[0064] For example, a natural language processing (NLP) algorithm can be used to parse the fault description information to obtain parsed fault information, and then the fault injection elements can be extracted from the parsed fault information. Parsing the fault description information with an NLP algorithm to extract the fault injection elements can improve the convenience and flexibility of fault injection element extraction.
[0065] After obtaining the fault injection element, the fault mode corresponding to the fault injection element can be determined. For example, the fault mode can be matched through a classification model, or by querying a fault knowledge base, etc. The fault mode can also be matched through other methods, which are not limited here.
[0066] In order to improve the accuracy and reliability of fault mode determination, the fault injection elements can be expanded with associated elements to obtain rich and diverse fault injection elements for accurate fault mode determination. In some embodiments, the fault injection elements can be extracted from the fault description information of the system to be tested, which may include:
[0067] Extract candidate fault injection elements from fault description information;
[0068] The candidate fault injection elements are expanded by associated elements to obtain the fault injection elements.
[0069] Specifically, candidate fault injection elements can be extracted from the fault description information through an element extraction model or an NLP algorithm, and then the candidate fault injection elements are expanded with associated elements to obtain fault injection elements. For example, elements associated with the candidate fault injection elements can be queried from the element library, and elements similar to the candidate fault injection elements can be obtained, etc. The associated elements, similar elements and candidate fault injection elements are combined into fault injection elements.
[0070] After the candidate fault injection elements are expanded with associated elements to obtain the fault injection elements, the fault mode corresponding to the fault injection elements may be determined. In some implementations, determining the fault mode corresponding to the fault injection elements may include:
[0071] The fault mode is classified based on the fault injection elements through the classification model, and the fault mode corresponding to the fault injection elements is obtained.
[0072] To improve the efficiency and accuracy of fault mode determination, a classification model can be used to classify fault modes based on the fault injection factors, thereby obtaining the corresponding fault modes. The specific model structure and model type of the classification model can be flexibly configured based on actual needs and are not limited here. The classification model can be trained using a fault dataset, so that the trained classification model can accurately output the corresponding fault mode based on the input fault injection factors. The specific training method of the classification model is not limited here.
[0073] To improve the convenience and flexibility of fault mode determination, the fault mode may be determined by querying a fault knowledge base. In some implementations, determining the fault mode corresponding to the fault injection element may include:
[0074] The fault mode corresponding to the fault injection element is searched from the pre-built fault knowledge base, which stores the corresponding relationship between the fault injection elements and the fault mode obtained based on the integration of historical fault data.
[0075] The fault knowledge base can be pre-processed and integrated based on historical fault data through a series of processes, including data cleaning, standardization, element extraction, and fault pattern matching. The fault knowledge base can store the correspondence between fault injection elements and fault patterns, as well as other information, which is not limited here. Historical fault data can include historical fault cases, historical fault injection elements, historical fault patterns, and historical fault types. Specifically, after obtaining the fault injection elements, the fault patterns corresponding to the fault injection elements can be searched from the pre-built fault knowledge base.
[0076] S102. Determine the root cause of the fault based on the fault mode and fault injection factors.
[0077] Among them, the root causes of the fault may include software errors caused by process crash, software errors caused by program memory overflow (Out of memory, OOM), software errors caused by permission exceptions, software errors caused by Transmission Control Protocol (Transmission Control Protocol, TCP) full connection, server hardware failure caused by memory failure, server hardware failure caused by hard disk failure, network anomalies caused by network disconnection, and network anomalies caused by switch failure, etc.
[0078] After obtaining the fault mode, the root cause of the fault can be further determined based on the fault mode and fault injection factors. The fault injection factors can be obtained by performing correlation factor expansion processing. For example, a prediction model can be used to predict the root cause of the fault based on the input fault mode and fault injection factors, and output the root cause of the fault. In another example, a fault knowledge base can be pre-built to store the corresponding relationships between fault modes, fault injection factors, and root causes. In this case, the root cause of the fault that matches the fault mode and fault injection factors can be obtained by querying the fault knowledge base. Of course, other methods can also be used to determine the root cause of the fault, which are not limited here.
[0079] In order to avoid simulating unfeasible faults and occupying subsequent simulation resources for ineffective testing, the fault can be simulated in a simulation environment first, and a preliminary judgment can be made on the rationality of the fault description information corresponding to the fault and the feasibility of simulation. After the simulation passes (i.e., the fault is reasonable and the simulation is feasible), subsequent simulations can be performed to improve the effectiveness of the fault test. In some embodiments, such as Figure 6 As shown, based on the failure mode and fault injection factors, the root cause of the failure can be determined, which may include:
[0080] S1021. Construct a simulation environment based on the fault mode and fault injection elements;
[0081] S1022. Perform fault injection in the simulation environment to perform fault simulation;
[0082] S1023. When the fault simulation passes, determine the root cause of the fault based on the fault mode and fault injection factors.
[0083] Specifically, after obtaining the fault mode and the fault injection element, a simulation environment may be constructed based on the fault mode and the fault injection element. For example, the fault environment parameters may be determined first, and then the simulation environment may be constructed based on the fault environment parameters. In some embodiments, constructing the simulation environment based on the fault mode and the fault injection element may include:
[0084] According to the fault mode and fault injection factors, determine the fault type corresponding to the fault mode;
[0085] Obtain fault environment parameters that match the fault mode and fault type;
[0086] Construct a simulation environment based on fault environment parameters and fault injection elements.
[0087] Among them, the fault type can include many different types such as software errors, hardware failures and network anomalies. One fault mode may correspond to one or more fault types. After obtaining the fault mode and fault injection elements, the fault type corresponding to the fault mode can be determined based on the fault mode and fault injection elements. The fault injection element can be a fault injection element obtained after the associated element expansion processing. For example, the neural network model can output the fault type based on the input fault mode and fault injection element. For another example, a fault knowledge base that stores the corresponding relationship between fault modes, fault injection elements and fault types can be pre-built. At this time, the fault type that matches the fault mode and fault injection element can be obtained by querying the fault knowledge base. Of course, the fault type can also be determined by other methods, which are not limited here.
[0088] To improve the efficiency and accuracy of fault type determination, a neural network model may be used to identify the fault type. In some implementations, determining the fault type corresponding to the fault mode based on the fault mode and the fault injection factor may include:
[0089] The neural network model is used to extract the features of the fault mode and fault injection elements to obtain the fault features;
[0090] The neural network model is used to identify the fault type according to the fault characteristics, and the fault type corresponding to the fault mode is obtained.
[0091] For example, the fault mode and fault injection elements can be input into a neural network model, and the neural network model can be used to extract features of the fault mode and fault injection elements to obtain fault features for distinguishing different fault types. Then, the neural network model can be used to identify the fault type based on the fault features to obtain the fault type corresponding to the fault mode. The specific model structure and model type of the neural network model can be flexibly set according to actual needs and are not limited here. The neural network model can be obtained by training with a fault data set, so that the trained neural network model can accurately output the corresponding fault type based on the input fault injection elements and fault mode. The specific training method of the neural network model is not limited here.
[0092] After obtaining the fault type, the fault environment parameters that match the fault mode and fault type can be obtained. For example, the fault environment parameters corresponding to the fault mode and fault type can be queried from a pre-built simulation fault library. The simulation fault library can store multiple fault modes corresponding to each fault, one or more fault types corresponding to each fault mode, and fault environment parameters corresponding to the fault mode and fault type in the form of a tree structure. The fault environment parameters may include hardware (such as memory, hard disk, CPU, etc.), operating system (such as Windows, Linux, etc.), network, application objects (such as web applications, etc.) required for fault injection, and are not limited here.
[0093] At this time, a simulation environment can be constructed based on the fault environment parameters and fault injection elements. For example, the simulation environment parameters required for the simulation service can be determined based on the fault environment parameters. The simulation environment parameters may include parameters corresponding to the hardware, operating system, network, and application objects required for the simulation service. The range of the simulation environment parameters is smaller than the range of the fault environment parameters. Then, a simulation environment is constructed based on the simulation environment parameters and fault injection elements.
[0094] After the simulation environment is constructed, fault injection can be performed in the simulation environment to perform fault simulation. To improve the convenience and accuracy of fault injection, fault injection can be performed based on the execution order of fault events. In some embodiments, performing fault injection in the simulation environment to perform fault simulation can include:
[0095] Generate fault events and fault event execution sequence for the system to be tested based on historical fault data in the fault knowledge base;
[0096] In the simulation environment, fault event injection is performed according to the fault event execution sequence and fault injection elements to simulate the fault event.
[0097] Specifically, based on the historical fault data in the fault knowledge base, discrete event simulation (DES) technology can be used to generate fault events and the execution sequence of fault events for the system to be tested. Then, in the simulation environment, according to the execution sequence of the fault events and the fault injection elements, the fault event injection is performed through the script to simulate the fault event and obtain the simulation result. The simulation result may include the fault simulation passing (such as the fault is reasonable and the simulation is feasible, etc.) or the fault simulation failing (such as the fault is unreasonable or the simulation is not feasible, etc.), and may also include the fault handling strategy corresponding to the fault, etc., which are not limited here.
[0098] In some embodiments, after performing fault injection in a simulation environment, the system testing method may further include: when the fault simulation fails, outputting prompt information, the prompt information indicating the reason for the failure of the fault simulation and an adjustment strategy for the fault description information. For example, when the fault simulation fails based on the simulation results, prompt information related to the reason for the failure of the fault simulation, the simulation adjustment strategy, and the adjustment strategy for the fault description information may be output, and targeted and effective simulation adjustments may be performed based on the prompt information to ensure that the fault simulation passes.
[0099] In some embodiments, when the fault simulation is determined to have passed based on the simulation results, a simulation report can be generated based on the data generated during the simulation and output. The simulation report can include the failure mode, failure type, affected application objects, and suggestions for fault mitigation or further testing. The simulation process can also be iteratively optimized based on feedback from the simulation results, which is not limited here.
[0100] When it is determined based on the simulation results that the fault simulation passes, the root cause of the fault may be determined based on the fault mode and the fault injection factors. In some embodiments, determining the root cause of the fault based on the fault mode and the fault injection factors may include:
[0101] The root cause of the fault is predicted based on the fault mode and fault injection factors through the prediction model to obtain the root cause of the fault.
[0102] The specific model structure and model type of the prediction model can be flexibly configured based on actual needs and are not limited here. By using the prediction model to predict the root cause of a fault (i.e., the fault root cause) based on the fault mode and fault injection factors, it can intelligently match the root cause. This not only simplifies the complexity of fault root cause identification but also improves the accuracy and efficiency of fault root cause matching, ensuring that subsequent fault simulation scenarios are more realistic and reliable.
[0103] To ensure the accuracy of predicting the root cause of a fault using a prediction model, the prediction model may be trained in advance. In some embodiments, the prediction model is used to predict the root cause of a fault based on the fault mode and fault injection factors. Before obtaining the root cause of the fault, the system testing method may further include:
[0104] Obtain a training dataset and a validation dataset, where the training dataset includes sample failure modes, sample failure injection factors, and sample failure root causes;
[0105] Through the prediction model, based on the sample failure mode and sample failure injection factors, the root cause of the failure is predicted to obtain the target root cause of the failure;
[0106] Adjust the parameters of the prediction model according to the difference between the sample fault root cause and the target fault root cause until the preset stopping condition is met;
[0107] The performance of the prediction model is verified through the validation data set. When the verification passes, the training of the prediction model is completed.
[0108] Specifically, a training data set and a verification data set can be obtained from a database. Both the training data set and the verification data set can include sample fault modes, sample fault injection elements, and sample fault root causes corresponding to a variety of faults, and can also include other information. The data in the verification data set may partially overlap with or not overlap with the data in the training data set, etc., which is not limited here. The sample fault modes and sample fault injection elements can be input into a prediction model (i.e., a prediction model to be trained). The prediction model predicts the root cause of the fault based on information such as the sample fault modes and sample fault injection elements, and outputs the target root cause of the fault. Then, the difference between the sample root cause of the fault and the target root cause of the fault can be calculated based on the loss function to obtain a loss value. The parameters of the prediction model can be adjusted based on the loss value until a preset stopping condition is met. The preset stopping condition can include minimizing the loss value or the number of training iterations reaching a preset number, etc., which is not limited here. At this point, the performance of the prediction model can be verified using a validation dataset. For example, the sample failure modes and sample failure injection factors in the validation dataset can be input into the prediction model. The root cause of the failure is predicted by the prediction model, and the root cause of the failure is output. If the output root cause of the failure meets expectations, the verification passes, and the training of the prediction model is completed. If the output root cause of the failure does not meet expectations, the verification fails. At this point, the prediction model needs to be trained until the trained prediction model passes verification.
[0109] In order to improve the accuracy and reliability of the prediction model's predictions, after the root cause of the fault is obtained through the prediction model, the prediction model can be further optimized by scoring the accuracy of the root cause of the fault predicted by the prediction model. In some embodiments, the root cause of the fault is predicted based on the fault mode and fault injection elements through the prediction model. After the root cause of the fault is obtained, the system testing method can also include: obtaining the accuracy score of the root cause of the fault predicted by the prediction model, and optimizing the prediction model according to the accuracy score.
[0110] For example, the root cause of the fault predicted by the prediction model can be displayed to the user, and the user's feedback on the accuracy score of the root cause of the fault predicted by the prediction model can be received, and the prediction model can be optimized based on the accuracy score. For another example, the root cause of the fault predicted by the prediction model can be input into a scoring model, and the scoring model outputs an accuracy score for the root cause of the fault predicted by the prediction model. The prediction model is optimized based on the accuracy score. The higher the accuracy score, the lower the degree of optimization of the prediction model needs, and the lower the accuracy score, the higher the degree of optimization of the prediction model needs. The specific optimization method of the prediction model, as well as the specific model structure and model type of the scoring model, can be flexibly set according to actual needs and are not limited here.
[0111] After the root cause of the fault is predicted by the prediction model, the prediction model can be further optimized using updated fault data to improve the accuracy and reliability of the prediction model. In some embodiments, the root cause of the fault is predicted based on the fault mode and fault injection elements through the prediction model. After the root cause of the fault is obtained, the system testing method can also include: when the fault data in the fault knowledge base is updated, obtaining the updated fault data; and optimizing the prediction model based on the updated fault data.
[0112] For example, it is possible to detect whether the fault data in the fault knowledge base has been updated. When the fault data in the fault knowledge base has been updated, the updated fault data can be obtained from the fault knowledge base, and the prediction model can be optimized based on the updated fault data. For another example, it is possible to detect whether the fault data in the fault knowledge base has been updated, and whether the amount of updated fault data has reached a preset quantity threshold. The specific value of the preset quantity threshold is not limited here. When the fault data in the fault knowledge base has been updated, and the amount of updated fault data has reached the preset quantity threshold, the updated fault data can be obtained from the fault knowledge base, and the prediction model can be optimized based on the updated fault data. When the fault data in the fault knowledge base has not been updated, the prediction model may not be optimized.
[0113] After the predictive model predicts the root cause of the fault, the predictive model can be further optimized using the accuracy score and updated fault data to improve the accuracy and reliability of the predictive model's predictions. In some embodiments, after the predictive model predicts the root cause of the fault based on the fault mode and fault injection factors and obtains the root cause of the fault, the system testing method can further include: obtaining an accuracy score for the root cause of the fault predicted by the predictive model, obtaining updated fault data from the fault knowledge base, and optimizing the predictive model based on the accuracy score and updated fault data. For example, the accuracy score of the root cause of the fault predicted by the predictive model, as determined by a user or a scoring model, and obtaining updated fault data from the fault knowledge base, can be used to optimize the predictive model based on the accuracy score and updated fault data.
[0114] It should be noted that in addition to outputting the root cause of the fault based on the fault mode and fault injection elements, the prediction model can also output the corresponding fault handling strategy, that is, the prediction model predicts the root cause of the fault based on the fault mode and fault injection elements, and outputs the root cause of the fault and its corresponding fault handling strategy. The fault handling strategy may include strategies for process crashes, strategies for memory failures, and strategies for network anomalies caused by network disconnection, etc. It may also include the fault propagation path, the potential impact of the fault on the system, and recommended mitigation strategies, etc., which are not limited here. At this time, a root cause report can be generated based on the root cause of the fault and its corresponding fault handling strategy, and the root cause report can be output. For example, natural language generation (NLG) technology can be used to convert the root cause of the fault and its corresponding fault handling strategy into a cause explanation that is easy for the user to understand. A root cause report is generated based on the cause explanation, and the root cause report is visually displayed.
[0115] S103: Construct a virtual environment based on the fault root cause and the fault injection elements, and perform fault injection in the virtual environment.
[0116] After obtaining the root cause of the fault and the fault injection factor, a virtual environment may be constructed based on the root cause of the fault and the fault injection factor to improve the accuracy and authenticity of the virtual environment construction. In some embodiments, constructing the virtual environment based on the root cause of the fault and the fault injection factor may include:
[0117] Determine the configuration parameters required to build a virtual environment based on the root causes of the faults and the fault injection factors;
[0118] Build a virtual environment based on configuration parameters.
[0119] For example, a database can be pre-built to store the corresponding relationships between fault root causes, fault injection elements, and configuration parameters. The fault injection elements can be obtained by expanding the associated elements. Then, the database is searched for configuration parameters that match the fault root causes and the fault injection elements, and a virtual environment for fault injection is constructed based on the configuration parameters. The configuration parameters may include parameters corresponding to the hardware configuration, operating system, network, and application objects required for the virtual service.
[0120] For another example, you can obtain fault virtual environment parameters that match the fault mode and fault type from a pre-built virtual fault library. Then, based on the root cause of the fault, the fault virtual environment parameters, and the fault injection elements, determine the configuration parameters required to build the virtual environment, and then build the virtual environment for fault injection based on the configuration parameters. The virtual fault library can store multiple fault modes corresponding to each fault, one or more fault types corresponding to each fault mode, and fault virtual environment parameters corresponding to the fault mode and fault type in the form of a tree structure. The fault virtual environment parameters may include virtual environment parameters such as hardware (such as memory, hard disk, CPU, etc.), operating system (such as Windows, Linux, etc.), network, and application objects (such as web applications, etc.) required to perform fault injection in the virtual environment, which are not limited here.
[0121] It should be noted that the fault virtual environment parameters can be different from or the same as the fault environment parameters required for the above-mentioned simulation environment construction, and the virtual fault library can be different from or the same as the above-mentioned simulation fault library. Optionally, in order to improve the accuracy of fault injection and the authenticity of fault simulation, the fault virtual environment parameters can be set to be different from the fault environment parameters required for the above-mentioned simulation environment construction, and the virtual fault library can be different from the above-mentioned simulation fault library. In addition, the constructed virtual environment can include multiple, highly realistic virtualized copies of the system architecture can be constructed using containerization or virtual machine technology to achieve multiple virtual environments running separately on multiple machines, ensuring the accuracy and isolation of the fault test environment.
[0122] After the virtual environment is constructed, fault injection may be performed in the virtual environment. In some implementations, performing fault injection in the virtual environment may include:
[0123] Obtaining the fault events and the execution order of the fault events for the system to be tested;
[0124] In a virtual environment, fault event injection is performed through scripts according to the fault event execution sequence and fault injection elements.
[0125] Specifically, based on historical fault data in a fault knowledge base, discrete event simulation (DES) technology can be used to generate fault events and their execution sequence for the system under test. Alternatively, fault events and their execution sequence can be obtained through other methods, which are not limited here. Then, in a virtual environment, fault event injection is performed through a script according to the fault event execution sequence and fault injection elements, improving the convenience and accuracy of fault injection.
[0126] S104: Acquire response data to the fault injection in the virtual environment, and generate a fault test result of the system to be tested according to the response data.
[0127] After performing fault injection in the virtual environment, response data to the fault injection in the virtual environment can be obtained, wherein the response data may include various data such as system load, CPU usage, memory usage, disk IO, TCP connection status, network bandwidth, and network packet loss rate, which are not limited here. Then, a fault test result of the system to be tested can be generated based on the response data. In some embodiments, generating the fault test result of the system to be tested based on the response data may include:
[0128] Analyze the system performance of the system to be tested according to the response data and obtain analysis results;
[0129] Generate fault test results for the system to be tested based on the analysis results.
[0130] For example, the system performance such as the system downtime and fault recovery time of the system to be tested can be analyzed in response to the data. For example, the fault recovery time can be determined based on the time difference between the time point when the fault occurs and the time point when the fault is recovered. Of course, other system performances of the system to be tested can also be analyzed, which is not limited here. After obtaining the analysis results on the system performance, the fault test results of the system to be tested can be generated according to the analysis results, so that the fault test results can reflect the system performance and improve the reliability of the generation of the fault test results. At this time, a test report (also referred to as an analysis report) can also be generated according to the fault test results, and the test report can be visually displayed. The test report can include information such as the system's vulnerabilities in hardware, operating system, network, application objects, etc., the response characteristics to different types of faults, and system optimization strategies, which are not limited here.
[0131] In some embodiments, as Figure 7 As shown, after generating the fault test result of the system to be tested according to the response data, the system testing method may further include:
[0132] S105. Generate a system optimization strategy based on the fault test results;
[0133] S106: Optimize the system to be tested according to the system optimization strategy.
[0134] After obtaining the fault test results, a system optimization strategy can be generated based on the fault test results. This system optimization strategy can be flexibly configured based on actual needs and is not limited here. The system under test can then be optimized based on the system optimization strategy to establish a closed-loop feedback mechanism. This allows for continuous iterative optimization of the system under test based on the fault test results, thereby improving its stability.
[0135] The present application can determine the fault mode corresponding to the fault injection element, determine the root cause of the fault based on the fault mode and the fault injection element, and increase the accuracy of the fault root cause matching based on the fault mode. Then, a virtual environment can be constructed based on the fault root cause and the fault injection element. Through the fault root cause, a virtual environment that accurately reflects the actual system architecture can be constructed, and fault injection can be performed in the virtual environment to simulate the actual fault realistically and dynamically, thereby improving the accuracy of fault injection. Finally, the response data for the fault injection in the virtual environment is obtained, and the fault test results of the system to be tested are generated based on the response data. Based on the accurately constructed virtual environment, the actual fault is realistically and dynamically simulated to implement fault testing of the system to be tested, thereby improving the accuracy of system testing.
[0136] The method described in the above embodiment is further described in detail below with examples.
[0137] This embodiment takes the system test device integrated into the server as an example. The server can be an independent server or a server cluster. It is not limited here. The application scenario of the server performing fault testing on the system is described in detail. Figure 8 , Figure 8A schematic diagram of the server architecture of the system testing method provided in an embodiment of the present application, wherein the server architecture may include a fault mode simulation engine, a fault root cause matching engine, and a fault injection unit, etc. The fault mode simulation engine, the fault root cause matching engine, and the fault injection unit may be integrated on the same server or on different servers, which is not limited here. Among them, the server can communicate with a terminal device provided with a user input interface through the fault mode simulation engine to receive fault description information sent by the terminal device through the information input interface, and then extract the fault injection element from the fault description information through the fault mode simulation engine, and determine the fault mode based on the fault injection element, and build a simulation environment according to the fault mode to perform fault simulation. When the fault simulation passes, the fault injection element is transmitted to the fault root cause matching engine through the fault mode simulation engine, and the fault root cause is matched based on the fault injection element by the fault root cause matching engine, and the fault root cause and the fault injection element are transmitted to the fault injection unit, and the fault injection unit builds a virtual environment based on the fault root cause and the fault injection element, and performs fault injection in the virtual environment, generates a fault test result based on the response data of the fault injection, and optimizes the target system (i.e., the system to be tested) based on the fault test result, which will be explained in detail below.
[0138] See also Figure 9 , Figure 9 This is an interactive diagram of the system testing method provided in the embodiment of the present application. The method process may include:
[0139] S201: A terminal device receives original fault description information for a target system input by a user through an information input interface.
[0140] Among them, Figure 8 As shown, the information input interface may include an information input module, an information processing module, and an information integration module, etc., which are not limited here.
[0141] The terminal device can receive the original fault description information for the target system input by the user through the information input module of the information input interface. The original fault description information can be used to describe user-defined fault phenomena and other information. The information input module may include a user input interface, which is designed to accurately and flexibly capture the original fault description information input by the user. The user input interface can adopt an intuitive and easy-to-operate user interface (UI) design, and support a variety of input methods, including free text description input method, structured drop-down menu selection input method, and interactive guide input method, to ensure that users, regardless of their technical background, can accurately express the specific circumstances of the fault scenario encountered, and help users fully explain the fault phenomenon.
[0142] For example, Figure 3As shown, the terminal device can receive the original fault description information entered by the user in the text box through the information input interface of the free text description input mode.
[0143] For example, Figure 4 As shown, the terminal device can receive the original fault description information selected by the user in the drop-down menu by triggering a selection button to display the drop-down menu through the structured drop-down menu selection input mode.
[0144] For example, Figure 5 As shown, the terminal device can receive the fault information or problem that the user needs to express in the dialog box through the information input interface of the interactive guide input method, and output feedback reply information after analyzing the fault information or problem input by the user, which is used to prompt the user to adjust the input or reply to the user's question. After one or more interactions, the original fault description information can be generated based on the interactive information.
[0145] S202: The terminal device preprocesses the original fault description information to obtain fault description information.
[0146] After receiving the original fault description information input by the user, the terminal device initiates a series of information processing and verification operations. The information processing module of the information input interface can perform pre-processing on the original fault description information, such as text regularization, verification of integrity and logical coherence, and verification of the legality of the information, to obtain processed information. The processed information is then converted and packaged based on the standardized format of the processed information through the information integration module to obtain the fault description information.
[0147] S203: The terminal device sends the fault description information to the server.
[0148] After receiving fault description information, the terminal device can send it to the server's fault mode simulation engine through the information integration module of the information input interface. After a series of verification and processing, the resulting fault description information is seamlessly integrated into the fault mode simulation engine, ensuring that the standardized fault description information can be accurately and efficiently transmitted to the fault mode simulation engine for further analysis and simulation. Furthermore, as the basic entry point for system testing, the information input interface lays a solid foundation for the subsequent fault analysis process. Through user-centric design and advanced data processing capabilities, the information input interface effectively bridges the gap between users' empirical knowledge of fault phenomena and the technical mechanisms used by system testing to simulate and analyze these faults. This not only improves the usability and accessibility of system testing, but also ensures that the fault injection process truly reflects users' actual experience and observations, thereby improving the accuracy and reliability of subsequent fault injection.
[0149] S204: The server receives the fault description information through the fault mode simulation engine, extracts the fault injection element from the fault description information, and determines the fault mode corresponding to the fault injection element.
[0150] Among them, Figure 8 As shown, the fault mode simulation engine may include an element extraction module, a fault mode identification module, a fault type identification module, a simulation environment construction module, a fault simulation execution module, and a simulation result analysis module, etc., which are not limited here. The fault mode simulation engine can convert the input fault description information into a structured fault mode representation, and can also be customized according to the characteristics of the system architecture of a specific target system to obtain a fault mode that matches the target system, so that the fault phenomenon described by the user can be accurately mapped to a reasonable fault scenario for fault simulation. The following will be explained in detail.
[0151] After receiving the fault description, the server can extract the fault injection elements from the fault description using the element extraction module of the fault mode simulation engine. For example, the element extraction module can perform in-depth analysis and parsing of the fault description using a pre-configured NLP algorithm to obtain parsed fault information. The server can then extract the fault injection elements from the parsed fault information using keyword extraction techniques. Optionally, to improve the accuracy and reliability of subsequent fault simulation, the fault injection elements can be expanded with related elements to obtain a rich and diverse set of fault injection elements for accurate subsequent processing.
[0152] Furthermore, the server can identify the fault mode corresponding to the fault injection element through the fault mode recognition module of the fault mode simulation engine. For example, the fault mode corresponding to the fault injection element can be identified using a classification model (or classification algorithm) pre-set in the fault mode recognition module, or by matching fault modes by querying a fault knowledge base. This classification model is optimized based on a large number of historical fault data sets and can accurately map fault description information to the corresponding fault mode based on the fault injection element.
[0153] S205. The server determines the fault type based on the fault mode and the fault injection elements through the fault mode simulation engine, builds a simulation environment based on the fault mode and the fault type, and performs fault injection in the simulation environment to perform fault simulation.
[0154] The server can determine the fault type based on the fault mode and fault injection elements using a decision tree or neural network model pre-set by the fault type identification module of the fault mode simulation engine. The fault injection element can be a fault injection element obtained after the associated element expansion processing. Then, the fault environment parameters that match the fault mode and fault type can be obtained through the simulation environment construction module, and the simulation environment parameters required for the simulation service can be determined based on the fault environment parameters. At this time, a simulation environment can be constructed based on the simulation environment parameters and the fault injection elements. The simulation environment can be a virtualized simulation environment that reflects the actual system architecture, ensuring that the simulated fault mode can be simulated and interacted in a virtualized simulation environment that is highly consistent with the real environment, thereby enhancing the authenticity and dynamics of the fault simulation and improving the accuracy of the simulation. In addition, software containers or virtual machine technology can be used to achieve isolation of the simulation environment, and fault injection can be performed in the isolated simulation environment to avoid any potential impact on the actual target system.
[0155] After establishing a simulation environment, the server can execute fault injection within the simulation environment through the fault simulation execution module of the fault mode simulation engine. For example, the fault simulation execution module can use discrete event simulation (DES) technology to generate fault events and the execution sequence of fault events for the system under test based on historical fault data in the fault knowledge base. Then, in the simulation environment, fault event injection is executed through a script according to the fault event execution sequence and fault injection elements to simulate the fault events and obtain simulation results. By using discrete event simulation (DES) technology, the time-dependent behavior of fault modes and their impact on system performance can be accurately simulated. In addition, agent-based modeling methods can be used to simulate the interactive behavior of different system components when faults occur, in order to capture the system's complex dynamics and emergency response processes.
[0156] By introducing a fault mode simulation engine and using fault environment parameters that match the fault mode and fault type to build a simulation environment, the server can dynamically convert user-defined fault phenomena into highly realistic and accurate fault mode simulations, ensuring that the simulation environment can reflect potential real-world scenarios. This provides a more solid foundation for system resilience testing and optimization, and solves the problem that traditional fault injection methods are often difficult to realistically and dynamically simulate real system failures.
[0157] S206: The server sends the simulation result to the terminal device through the fault mode simulation engine.
[0158] After obtaining the simulation results, if the fault simulation fails, the server can send the simulation results of the failure of the fault simulation to the terminal device through the fault mode simulation engine, as well as relevant prompt information such as the reason for the failure of the fault simulation, the adjustment strategy for the fault description information, etc. The terminal device can display it to the user so that the user can make targeted and effective simulation adjustments based on the prompt information.
[0159] If the fault simulation passes, the server can analyze the data and simulation results generated during the simulation process through the simulation result analysis module of the fault mode simulation engine. For example, data analysis and visualization tools can be used to analyze the specific impact of the fault on system performance, reliability, and security, and generate a simulation report. The simulation report can include the fault mode, fault type, affected application objects (i.e., system components), and suggestions for fault mitigation or further testing. The server can send the simulation report to the terminal device through the fault mode simulation engine, and the terminal device can visualize the simulation report for the user to view. Based on the simulation results, the server can iteratively optimize the simulation process through the fault mode simulation engine and further refine the fault environment parameters, continuously improving the match and correlation with the user-defined fault phenomenon (i.e., fault description information), accurately simulating the user's required fault scenario, which not only helps to deeply reveal potential system vulnerabilities, but also provides strong support for the system's proactive defense and response to real-world fault conditions.
[0160] S207: When the fault simulation passes, the server transmits the fault mode and fault injection elements to the fault root cause matching engine through the fault mode simulation engine.
[0161] Among them, Figure 8 As shown, the fault root cause matching engine may include a data processing module, a fault analysis module, a prediction model training module, a fault root cause matching module, a model optimization module, and a report output module, etc., which are not limited here.
[0162] In addition to transmitting both the fault mode and the fault injection element to the fault root cause matching engine through the fault mode simulation engine, the server can also transmit only the fault injection element to the fault root cause matching engine through the fault mode simulation engine. In this case, the fault analysis module of the fault root cause matching engine can identify the fault mode based on the fault injection element to obtain the fault pattern. For example, the fault analysis module can identify the fault mode corresponding to the fault injection element through a pre-configured classification model, or match the fault mode by querying a fault knowledge base. The fault injection element transmitted to the fault root cause matching engine can be the fault injection element obtained after correlation element expansion.
[0163] After obtaining the fault mode and fault injection elements, the server can expand the fault injection elements through the data processing module of the fault root cause matching engine, and perform factor expansion processing on the associated elements to obtain rich and diverse fault injection elements, so as to accurately match the fault root cause based on the expanded fault injection elements.
[0164] It should be noted that the execution order between step S206 and step S207 is not limited here. For example, step S206 and step S207 can be executed at the same time. For another example, step S206 can be executed first and then step S207. For another example, step S207 can be executed first and then step S206, etc.
[0165] S208: The server predicts the root cause of the fault based on the fault mode and the fault injection factor using a prediction model preset in the fault root cause matching engine to obtain the root cause of the fault.
[0166] The server can pre-train the prediction model using the prediction model training module of the fault root cause matching engine. For example, machine learning algorithms, particularly supervised learning models such as Classification and Regression Trees (CART) and random forests, can be used to develop a prediction model that can accurately map fault modes to potential root causes. Training and validation datasets can also be constructed. Both training and validation datasets can include sample fault modes, sample fault injection factors, and sample root causes corresponding to multiple faults. Other information can also be included. The data in the validation dataset may or may not overlap with the data in the training dataset, but this is not limited here. The prediction model is first trained using the training dataset. After completing the first phase of training, the second phase begins: the prediction model's performance is verified using the validation dataset to evaluate performance indicators such as accuracy, precision, recall, and F1 score. The prediction model is trained until it passes the validation (i.e., meets performance standards). The model is trained in segments using the training and validation datasets, and cross-validation techniques are used to optimize the prediction model's parameters to avoid overfitting. And according to the complexity and variability of the training data set and the validation data set, the prediction model is trained in combination with ensemble learning or deep learning architecture to improve the accuracy, reliability and robustness of the prediction model in predicting the root cause of the fault.
[0167] At this time, the server can predict the root cause of the fault based on the fault mode and fault injection factors through the prediction model preset in the root cause matching module of the fault root cause matching engine, obtain the root cause of the fault, and realize intelligent root cause identification.
[0168] The server can integrate a feedback loop mechanism through the fault root cause matching engine, which can continuously optimize the prediction model based on updated fault data and user feedback accuracy scores, ensuring that the prediction model can adapt to the evolving system architecture and emerging fault modes, thereby improving the accuracy and reliability of the prediction model's predictions. Specifically, after the fault root cause is predicted by the prediction model, the model optimization module of the fault root cause matching engine can obtain the user's accuracy score for the fault root cause predicted by the prediction model, as well as the updated fault data in the fault knowledge base. Then, based on the accuracy score and updated fault data, the prediction model is optimized to maintain the cutting-edge and accuracy of the prediction model's fault cause matching process.
[0169] By introducing an AI-driven fault root cause matching engine, the server uses machine learning algorithms to conduct in-depth analysis of simulated fault patterns, accurately and intelligently matching fault root causes from fault patterns. This engine can precisely associate specific fault simulations with their root causes (i.e., the root causes of the faults). This not only simplifies the complex process of fault root cause matching but also significantly improves the accuracy and relevance of the fault injection process, enabling precise diagnosis and resolution of system faults, providing strong assurance for system reliability and security. This addresses the issue of traditional fault injection technology, which typically only makes preliminary judgments based on user-described fault symptoms and fails to identify the root cause of the fault.
[0170] S209: The server sends a fault root cause report to the terminal device through the fault root cause matching engine.
[0171] After obtaining the root cause of the fault, the server can use the report output module of the fault root cause matching engine, using natural language generation (NLG) technology, to convert the output of the prediction model into a user-friendly explanation of the cause. Based on this explanation, a root cause report is generated to improve the user's interpretability of the fault root cause prediction results. The root cause report may include the potential impact of the fault root cause on the system and recommended fault mitigation strategies. The server can send the fault root cause report to the terminal device through the fault root cause matching engine, so that the terminal device can visualize the root cause report in a clear and operational form. The terminal device can also use data visualization tools to display fault causal relationships and fault propagation paths, helping users to gain a deeper understanding of the fault dynamics within the system.
[0172] S210: The server transmits the fault root cause and the fault injection element to the fault injection unit through the fault root cause matching engine.
[0173] Among them, Figure 8As shown, the fault injection unit may include an environment parameter configuration module, a fault scenario preparation module (fault events and their execution sequence), a virtual environment construction module, a fault input execution module, a response monitoring module, and a system fault analysis module, etc., which are not limited here.
[0174] The server can transmit the root cause of the fault and the fault injection element to the fault injection unit through the fault root cause matching engine. The fault injection element can be the fault injection element obtained after the associated element expansion processing. The fault injection unit converts the fault root cause and other information obtained from the previous analysis into simulated fault conditions in the virtualized system environment to build a virtual environment to perform fault injection. By simulating faults safely and in a controlled manner, a comprehensive and in-depth evaluation of the system's resilience and recovery strategies can be performed.
[0175] It should be noted that the execution order between step S209 and step S210 is not limited here. For example, step S209 and step S210 can be executed at the same time. For another example, step S209 can be executed first and then step S210. For another example, step S210 can be executed first and then step S209, etc.
[0176] S211. The server constructs a virtual environment based on the fault root cause and the fault injection elements through the fault injection unit, and performs fault injection in the virtual environment.
[0177] The server can use the environmental parameter configuration module of the fault injection unit to determine the configuration parameters required to build a virtual environment based on the root cause of the fault and the fault injection elements. The server can then use the virtual environment construction module to build a virtual environment for fault injection based on the configuration parameters. For example, the virtual environment construction module can obtain fault virtual environment parameters (such as fault type, location, intensity, and duration) that match the fault mode and fault type. Then, based on the root cause of the fault, the fault virtual environment parameters, and the fault injection elements, the server can determine the configuration parameters required to build the virtual environment. The virtual environment for fault injection can then be built based on the configuration parameters. The constructed virtual environment can include multiple virtual environments. Containerization or virtual machine technology can be used to build highly realistic virtual copies of the system architecture to obtain multiple virtual environments, each of which can be run separately on multiple machines to ensure the accuracy and isolation of the fault test environment. In addition, the virtual environment construction module can introduce network virtualization technology to accurately simulate the system's communication infrastructure and achieve realistic simulation of network-related fault scenarios. Through detailed network modeling, it is ensured that the fault injection process can fully reflect the system's behavior in the actual network environment.
[0178] After the virtual environment is constructed, the fault scenario preparation module of the fault injection unit can be used to generate fault events and the fault event execution sequence for the system to be tested based on historical fault data in the fault knowledge base using discrete event simulation (DES) technology. The fault input execution module then executes the fault event injection in the virtual environment according to the fault event execution sequence and fault injection elements through a script. The fault input execution module has the ability to precisely control the time, sequence, and intensity of fault injection, ensuring that each fault event is executed precisely according to the predetermined plan. The use of a script-based automated injection method can achieve accurate and rapid deployment and flexible adjustment of the virtual environment corresponding to the fault scenario, ensuring that the fault scenario can be accurately and orderly introduced into the virtual environment (i.e., the virtualized system environment), improving the efficiency and accuracy of fault injection.
[0179] By introducing a fault injection unit, the server simulates faults in a virtual environment that accurately reflects the actual system architecture, effectively reducing the need for hardware modifications and significantly reducing testing costs. This provides a cost-effective and secure fault injection mechanism. Furthermore, this virtualized environment ensures that the fault injection process does not compromise system stability or data integrity, significantly improving the safety of fault injection. This addresses the challenges of traditional hardware-based fault injection methods, which often come with high testing costs, potential operational risks, and the risk of damage to the physical system.
[0180] S212. The server obtains response data to the fault injection in the virtual environment through the fault injection unit, generates a fault test result of the system to be tested according to the response data, and optimizes the target system according to the test result.
[0181] The server can obtain response data for fault injection in the virtual environment through the response monitoring module of the fault injection unit, and analyze the system performance of the system to be tested based on the response data through the system fault analysis module to obtain analysis results, generate fault test results of the system to be tested based on the analysis results, and optimize various aspects of the target system such as hardware, network, operating system and application objects based on the test results.
[0182] Among them, the response monitoring module can integrate real-time monitoring and logging functions, and use monitoring tools to capture the system's response data to injected faults in real time to track the system's performance, stability and error handling response in real time, and record fault events and abnormal conditions in detail, etc., to provide rich and detailed data support for subsequent system behavior and recovery mechanism analysis. In addition, by implementing a refined monitoring mechanism, it can ensure that the fault injection process meets the planned requirements, reduce the occurrence of unexpected deviations, and improve the reliability of the test.
[0183] The system fault analysis module enables in-depth analysis of collected response data and comprehensive assessment of system resilience. For example, by quantifying and analyzing system performance indicators such as system downtime and recovery time, the robustness of the system's fault-tolerance mechanism can be accurately measured. Based on the analysis results, a detailed test report can be compiled to clearly present the results of the fault injection test. This test report can reveal system vulnerabilities, response characteristics to different types of faults, and improvements needed in system design and resilience strategies.
[0184] By introducing a fault injection unit, the server can play a vital role in verifying and strengthening the system's defense capabilities against potential faults. By building a virtual environment to simulate real fault conditions and deeply analyzing the system's response, it provides effective information for the effectiveness of the resilience strategy tested by the system and outputs key improvement strategies, thereby promoting the continuous improvement of system reliability and robustness. In addition, it can simulate and analyze multiple fault scenarios, accurately identify potential root causes of faults, including complex fault scenarios not yet encountered in the real world, ensuring that the fault simulation scenarios are closer to the real situation. The precise fault root cause matching mechanism makes fault injection more targeted, providing valuable insights into revealing system vulnerabilities, allowing system administrators and developers to understand and resolve potential system vulnerabilities in advance, thereby enhancing the system's resilience and response capabilities. By reducing downtime during system operation and improving service availability, the overall performance of the system is effectively improved.
[0185] S213. The server sends the fault test result to the terminal device through the fault injection unit.
[0186] After obtaining the test results, the server can send the fault test results to the terminal device through the fault injection unit, thereby establishing a closed-loop feedback mechanism. The fault test results are effectively fed back to the system development and maintenance team and other relevant personnel through the terminal device. Based on the fault test results, the system architecture, software code base, and change specifications of the target system are continuously optimized through iteration, continuously enhancing the system's resilience to future faults, improving the accuracy and efficiency of system testing, and improving the system's operational capabilities. In addition, the response data collected from the system's fault simulation process provides strong support for the formulation of preventive maintenance strategies. By identifying potential failure points and assessing their impact, more targeted system maintenance work and optimized system resource allocation can be carried out, thereby reducing the risk of system downtime and improving the long-term stability of the system.
[0187] In the above embodiments, the description of each embodiment has its own focus. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the system testing method above, and will not be repeated here.
[0188] In an embodiment of the present application, the system test can be divided into three stages: the first stage is the fault simulation stage, including: building a simulation environment based on the fault mode and fault type through a fault mode simulation engine, and performing fault injection in the simulation environment to perform fault simulation, so as to judge the rationality and simulation feasibility of the input fault description information. If it is determined to be reasonable and the fault can be simulated according to the simulation results, the second stage is entered; the second stage is the fault root cause matching stage, including: inputting the fault mode and fault injection elements into the prediction model through the fault root cause matching engine to predict the fault root cause, and outputting the fault root cause; the third stage is the fault injection stage, including: building a virtual environment based on the fault root cause through a fault injection unit, and injecting faults into the virtual environment for testing and optimization.
[0189] On the one hand, by performing fault injection in a simulation environment to perform fault simulation, the rationality and simulation feasibility of the input fault description information are judged, so that the rationality and simulation feasibility of the fault can be preliminarily judged in advance in order to perform subsequent simulations, avoiding infeasible faults occupying subsequent simulation resources for invalid testing, and improving the effectiveness of fault testing.
[0190] On the other hand, after the fault simulation determines that the fault is reasonable and the simulation is feasible, the root cause of the fault can be predicted through the prediction model, and the user-defined fault phenomenon can be intelligently matched with the root cause of the fault. This not only simplifies the complexity of fault root cause identification, but also improves the accuracy and efficiency of fault root cause matching, thereby ensuring that subsequent simulation scenarios are more realistic and reliable.
[0191] On the other hand, by constructing a virtual environment based on the root causes of faults that accurately reflects the actual system architecture and injecting faults into this virtual environment for testing and optimization, not only can user-defined fault phenomena be dynamically converted into highly realistic and accurate fault modes for simulation, but they can also realistically and dynamically simulate real system faults, ensuring that simulated faults reflect potential real-world fault scenarios. This improves the accuracy, relevance, and applicability of fault testing in complex system architectures and addresses the problem that traditional simulation methods reduce the fidelity of the fault injection process, resulting in a gap between simulated conditions and the actual operating environment, and insufficiently assessing system behavior under actual fault conditions. Furthermore, by simulating faults and analyzing system responses in the constructed virtual environment, we can gain a more comprehensive understanding of the system's behavior patterns under various fault conditions, providing strong support for system design and architecture optimization. Furthermore, this virtualized environment ensures that the fault injection process does not compromise system stability or data integrity, improving the security of fault injection and addressing the risk of fault injection techniques implemented in traditional software increasing system workload and changing the original software structure, thereby reducing system stability and security.
[0192] In addition, the system can be dynamically iterated and optimized for different fault scenarios to improve system stability. The modular design and artificial intelligence-enhanced analysis capabilities improve the flexibility and scalability of fault injection and can adapt to the evolving system architecture. Moreover, by eliminating the need for physical fault injection hardware and reducing the risk of direct system operations, the use of a virtualized environment for fault simulation not only avoids hardware costs and effectively reduces the need for hardware modifications, but also reduces the expensive costs caused by operational interruptions, thereby significantly reducing testing costs and improving overall testing efficiency, solving the problems of high cost, low scalability and flexibility of traditional hardware-based fault injection mechanisms.
[0193] To facilitate better implementation of the system testing method provided in the embodiment of the present application, the embodiment of the present application also provides a device based on the above system testing method. The meanings of the terms are the same as those in the above system testing method, and the specific implementation details can be referred to the description in the method embodiment.
[0194] See also Figure 10 , Figure 10 This is a structural diagram of a system testing device provided in an embodiment of the present application, wherein the system testing device 300 may include a pattern determination module 301, a root cause determination module 302, a fault injection module 303, and a result generation module 304, etc.
[0195] Wherein, the mode determination module 301 is used to determine the fault mode corresponding to the fault injection element;
[0196] A root cause determination module 302 is configured to determine a root cause of a fault based on the fault mode and the fault injection factor;
[0197] A fault injection module 303 is configured to construct a virtual environment based on the fault root cause and the fault injection elements, and perform fault injection in the virtual environment;
[0198] The result generating module 304 is configured to obtain response data to the fault injection in the virtual environment and generate a fault test result of the system to be tested according to the response data.
[0199] In some implementations, the root cause determination module 302 may include:
[0200] The construction submodule is used to build a simulation environment based on the fault mode and fault injection elements;
[0201] An injection submodule, for performing fault injection in a simulation environment to perform fault simulation;
[0202] The determination submodule is used to determine the root cause of the fault based on the fault mode and fault injection factors when the fault simulation passes.
[0203] In some implementations, the determination submodule is specifically configured to: predict the root cause of the fault according to the fault mode and the fault injection element using a prediction model to obtain the root cause of the fault.
[0204] In some embodiments, the construction submodule is specifically used to: determine the fault type corresponding to the fault mode according to the fault mode and fault injection elements; obtain fault environment parameters matching the fault mode and fault type; and construct a simulation environment according to the fault environment parameters and fault injection elements.
[0205] In some embodiments, the construction submodule is further specifically used to: extract features of the fault mode and fault injection elements through a neural network model to obtain fault features; identify the fault type according to the fault features through a neural network model to obtain the fault type corresponding to the fault mode.
[0206] In some embodiments, the system testing apparatus 300 further includes:
[0207] The output module is used to output prompt information when the fault simulation fails. The prompt information is used to indicate the reason why the fault simulation fails and the adjustment strategy for the fault description information.
[0208] In some embodiments, the system testing apparatus 300 further includes:
[0209] The element extraction module is used to extract fault injection elements from the fault description information of the system to be tested.
[0210] In some implementations, the element extraction module is further specifically configured to: extract candidate fault injection elements from the fault description information; and perform correlation element expansion processing on the candidate fault injection elements to obtain the fault injection elements.
[0211] In some embodiments, the pattern determination module 301 is specifically used to: classify fault patterns based on fault injection elements through a classification model to obtain fault patterns corresponding to the fault injection elements; or, search for fault patterns corresponding to the fault injection elements from a pre-built fault knowledge base, where the fault knowledge base stores the correspondence between fault injection elements and fault patterns obtained based on the integration of historical fault data.
[0212] In some implementations, the fault injection module 303 is specifically configured to: determine configuration parameters required for building a virtual environment according to the fault root cause and the fault injection element; and build the virtual environment according to the configuration parameters.
[0213] In some implementations, the fault injection module 303 is further specifically configured to: obtain fault events and a fault event execution sequence for the system to be tested; and execute fault event injection through a script in a virtual environment according to the fault event execution sequence and fault injection elements.
[0214] In some implementations, the result generation module 304 is specifically configured to: analyze the system performance of the system to be tested according to the response data to obtain an analysis result; and generate a fault test result of the system to be tested according to the analysis result.
[0215] In some embodiments, the system testing apparatus 300 further includes:
[0216] The processing module is used to generate a system optimization strategy according to the fault test results; and optimize the system to be tested according to the system optimization strategy.
[0217] In the above embodiments, the description of each embodiment has its own focus. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the system testing method above, and will not be repeated here.
[0218] In an embodiment of the present application, the pattern determination module 301 can determine the fault pattern corresponding to the fault injection element, and the root cause determination module 302 can determine the root cause of the fault based on the fault pattern and the fault injection element. The accuracy of the fault root cause matching can be increased based on the fault pattern. Then, the fault injection module 303 can construct a virtual environment based on the fault root cause and the fault injection element. The virtual environment that accurately reflects the actual system architecture can be constructed through the fault root cause, and fault injection is performed in the virtual environment to simulate the actual fault in a realistic and dynamic manner, thereby improving the accuracy of fault injection. Finally, the result generation module 304 obtains the response data for the fault injection in the virtual environment, generates the fault test results of the system to be tested based on the response data, and realizes the fault test of the system to be tested by realistically and dynamically simulating the actual fault based on the accurately constructed virtual environment, thereby improving the accuracy of the system test.
[0219] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0220] The embodiment of the present application also provides a computer device, which may be a server, etc. Figure 11 , which shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:
[0221] The computer device may include one or more processing core processors 401, one or more computer readable storage media memories 402, a power supply 403, an input unit 404 and other components. Those skilled in the art will understand that Figure 11 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.
[0222] Processor 401 is the control center of the computer device. It connects all components of the computer device using various interfaces and circuits. It executes software programs and / or modules stored in memory 402 and accesses data stored in memory 402 to perform various computer functions and process data. Optionally, processor 401 may include one or more processing cores. Preferably, processor 401 integrates an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 401.
[0223] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0224] The computer device also includes a power supply 403 for supplying power to various components. Preferably, the power supply 403 can be logically connected to the processor 401 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 403 can also include one or more DC or AC power supplies, a recharging system, a power fault injection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.
[0225] The computer device may further include an input unit 404, which may be configured to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0226] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the computer device will load the executable files corresponding to one or more application processes into the memory 402 according to the following instructions, and the processor 401 will run the application stored in the memory 402 to implement various functions as follows:
[0227] Determine the fault mode corresponding to the fault injection element, and determine the root cause of the fault based on the fault mode and fault injection element; build a virtual environment based on the root cause of the fault and the fault injection element, and perform fault injection in the virtual environment; obtain response data to the fault injection in the virtual environment, and generate fault test results for the system to be tested based on the response data.
[0228] In some embodiments, when determining the root cause of the fault based on the fault mode and fault injection elements, the processor 401 further executes: constructing a simulation environment based on the fault mode and fault injection elements; performing fault injection in the simulation environment to perform fault simulation; and when the fault simulation passes, determining the root cause of the fault based on the fault mode and fault injection elements.
[0229] In some implementations, when determining the root cause of the fault according to the fault mode and the fault injection factor, the processor 401 further executes: predicting the root cause of the fault according to the fault mode and the fault injection factor using a prediction model to obtain the root cause of the fault.
[0230] In some embodiments, when constructing a simulation environment based on a fault mode and fault injection elements, the processor 401 further executes: determining a fault type corresponding to the fault mode based on the fault mode and fault injection elements; obtaining fault environment parameters that match the fault mode and fault type; and constructing a simulation environment based on the fault environment parameters and the fault injection elements.
[0231] In some embodiments, when determining the fault type corresponding to the fault mode based on the fault mode and the fault injection element, the processor 401 further executes: extracting features of the fault mode and the fault injection element through a neural network model to obtain fault features; and identifying the fault type based on the fault features through a neural network model to obtain the fault type corresponding to the fault mode.
[0232] In some implementations, the processor 401 further executes: when the fault simulation fails, outputting prompt information, where the prompt information is used to indicate the reason why the fault simulation fails and an adjustment strategy for the fault description information.
[0233] In some implementations, the processor 401 further performs: extracting fault injection elements from fault description information of the system to be tested;
[0234] When extracting fault injection elements from the fault description information of the system to be tested, the processor 401 further executes: extracting candidate fault injection elements from the fault description information; and performing correlation element expansion processing on the candidate fault injection elements to obtain fault injection elements.
[0235] In some embodiments, when determining the fault mode corresponding to the fault injection element, the processor 401 further executes: classifying the fault mode based on the fault injection element through a classification model to obtain the fault mode corresponding to the fault injection element; or searching for the fault mode corresponding to the fault injection element from a pre-built fault knowledge base, where the fault knowledge base stores the correspondence between the fault injection elements and the fault modes obtained based on the integration of historical fault data.
[0236] In some implementations, when constructing a virtual environment based on the fault root cause and the fault injection element, the processor 401 further executes: determining configuration parameters required for constructing the virtual environment based on the fault root cause and the fault injection element; and constructing the virtual environment based on the configuration parameters.
[0237] In some embodiments, when performing fault injection in a virtual environment, the processor 401 further performs: obtaining fault events and a fault event execution sequence for the system to be tested; and performing fault event injection through a script in the virtual environment according to the fault event execution sequence and the fault injection elements.
[0238] In some embodiments, when generating a fault test result of the system to be tested based on the response data, the processor 401 further executes: analyzing system performance of the system to be tested based on the response data to obtain an analysis result; and generating a fault test result of the system to be tested based on the analysis result.
[0239] In some implementations, the processor 401 further executes: generating a system optimization strategy according to the fault test result; and optimizing the system to be tested according to the system optimization strategy.
[0240] In the above embodiments, the description of each embodiment has its own focus. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the system testing method above, and will not be repeated here.
[0241] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the above embodiments.
[0242] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be accomplished by computer instructions, or by controlling related hardware through computer instructions. The computer instructions can be stored in a computer-readable storage medium (i.e., a storage medium) and loaded and executed by a processor. To this end, an embodiment of the present application provides a storage medium having a computer program stored therein. The computer program can include computer instructions, and the computer program can be loaded by a processor to execute any of the system testing methods provided in the embodiments of the present application.
[0243] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0244] The storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0245] Since the instructions stored in the storage medium can execute the steps in any system testing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any system testing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0246] The above is a detailed introduction to a system testing method, device, computer equipment, storage medium and program product provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A system testing method, characterized in that: include: Determine the failure mode corresponding to the fault injection element; Determine the root cause of the fault according to the fault mode and the fault injection factor; Building a virtual environment according to the fault root cause and the fault injection element, and performing fault injection in the virtual environment; Response data to fault injection in the virtual environment is acquired, and a fault test result of the system to be tested is generated according to the response data.
2. The system testing method according to claim 1, characterized in that: The determining the root cause of the fault according to the fault mode and the fault injection element includes: Constructing a simulation environment according to the fault mode and the fault injection elements; Performing fault injection in the simulation environment to perform fault simulation; When the fault simulation passes, the root cause of the fault is determined according to the fault mode and the fault injection element.
3. The system testing method according to claim 2, characterized in that: The determining the root cause of the fault according to the fault mode and the fault injection element includes: The root cause of the fault is predicted based on the fault mode and fault injection factors through the prediction model to obtain the root cause of the fault.
4. The system testing method according to claim 2, characterized in that: The constructing of a simulation environment according to the fault mode and the fault injection element comprises: Determine, according to the fault mode and the fault injection element, a fault type corresponding to the fault mode; Acquire fault environment parameters that match the fault mode and the fault type; A simulation environment is constructed according to the fault environment parameters and the fault injection elements.
5. The system testing method according to claim 4, characterized in that: The determining, according to the fault mode and the fault injection element, a fault type corresponding to the fault mode includes: Extracting features of the fault mode and the fault injection element through a neural network model to obtain fault features; The neural network model is used to identify the fault type according to the fault characteristics to obtain the fault type corresponding to the fault mode.
6. The system testing method according to claim 1, characterized in that: The method further comprises: extracting fault injection elements from fault description information of the system to be tested; The extracting of fault injection elements from the fault description information of the system to be tested includes: Extracting candidate fault injection elements from the fault description information; The candidate fault injection elements are subjected to correlation element expansion processing to obtain fault injection elements.
7. The system testing method according to claim 1, characterized in that: The determining the fault mode corresponding to the fault injection element includes: Classify the fault mode based on the fault injection element through a classification model to obtain the fault mode corresponding to the fault injection element; or, The fault mode corresponding to the fault injection element is searched from a pre-built fault knowledge base, wherein the fault knowledge base stores the corresponding relationship between the fault injection element and the fault mode obtained based on the integration of historical fault data.
8. The system testing method according to claim 1, characterized in that: The step of constructing a virtual environment according to the fault root cause and the fault injection element comprises: Determining configuration parameters required for building a virtual environment according to the fault root cause and the fault injection element; A virtual environment is constructed according to the configuration parameters.
9. The system testing method according to claim 1, characterized in that: The performing fault injection in the virtual environment includes: Obtaining fault events and a fault event execution sequence for the system to be tested; In the virtual environment, the fault event injection is performed through a script according to the fault event execution sequence and the fault injection elements.
10. The system testing method according to any one of claims 1 to 9, characterized in that: Generating the fault test result of the system to be tested according to the response data includes: Analyze the system performance of the system to be tested according to the response data to obtain an analysis result; A fault test result of the system to be tested is generated according to the analysis result.
11. A system testing device, characterized in that: include: A mode determination module, used to determine the fault mode corresponding to the fault injection element; A root cause determination module, used to determine the root cause of the fault according to the fault mode and the fault injection element; A fault injection module, used to construct a virtual environment according to the fault root cause and the fault injection element, and perform fault injection in the virtual environment; The result generating module is used to obtain response data to the fault injection in the virtual environment, and generate the fault test result of the system to be tested according to the response data.
12. A computer device, characterized in that: The system comprises a processor and a memory, wherein the memory stores a computer program, and the processor executes the system testing method according to any one of claims 1 to 10 when calling the computer program in the memory.
13. A storage medium, characterized in that: The storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the system testing method according to any one of claims 1 to 10.
14. A computer program product, comprising a computer program, wherein the computer program is loaded by a processor to execute the system testing method according to any one of claims 1 to 10.
Citation Information
Cited By
Communication network operation accident simulation drilling method and device
CN121418305A
Method and device for fault injection
WO2026192468A1
