Method and apparatus for custom type fault simulation in java programs

CN115408299BActive Publication Date: 2026-09-25CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211199547.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2026-09-25
Estimated Expiration
2042-09-29

AI Technical Summary

Technical Problem

[0003]申请人通过调研发现目前常用的混沌工具比如chaosmesh、chaosd大多都只实现了java框架普通异常类型(IOException)或方法返回值基本类型(String)的注入,无法模拟注入自定义复杂对象类型和自定义异常类型的注入

Benefits of technology

[0012]由上述技术方案可知,本申请提供的Java程序中自定义类型故障模拟方法和装置,可达到注入自定义返回值为复杂对象类型和自定义异常类型的目的,并且该方法可同时适用于虚拟机和容器不同的底层基础设施环境。因此本申请不仅完善了混沌工程领域故障模拟的类型,并且可扩展到容器和虚拟机环境Java程序运行时动态注入各种类型和异常,既为测试人员提供了质量保障的有效手段又同时提升了测试的效率,也为开发人员的编码调试自测环节提供了便捷。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408299B_ABST
    Figure CN115408299B_ABST
Patent Text Reader

Abstract

The application provides a self-defined type fault simulation method and device in a Java program, and relates to the technical field of chaos engineering. The method comprises the following steps: completing template definition during self-defined exception type injection and return complex object type injection in the Java program according to a self-defined type fault model; inputting fault rule parameters to generate a fault rule instance through the template defined by the self-defined type fault model; loading and analyzing the fault rule instance to obtain analysis data; and calling the JVM to execute fault injection corresponding to the fault rule according to the analysis data, and returning a fault injection simulation result. The application can achieve the purpose of injecting self-defined return values as complex object types and self-defined exception types, and the method can be simultaneously applied to different underlying infrastructure environments of virtual machines and containers. The application provides an effective means of quality assurance for testers, improves the testing efficiency, and provides convenience for the self-test link of coding and debugging of developers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of chaos engineering technology, and in particular to a method and apparatus for simulating custom-type faults in a Java program. Background Technology

[0002] Abstraction is a crucial step in software design and development. Through abstraction, various complex custom types are defined and mapped within the system, and all methods and business calls between upstream and downstream processes are based on these custom types. In real-world environments, the entire call chain of a software system frequently encounters various exceptions due to software and hardware failures. Taking JVM type exceptions as an example, these not only include known exception types defined in Java such as NullPointerException and IOException, but also the most common exception types are various user-defined type exceptions. For example, in the case of custom return value injection, the methods frequently injected often do not return basic types like string or int, but rather complex abstract types.

[0003] The applicant's research revealed that most commonly used chaos tools, such as chaosmesh and chaosd, only implement injection of Java framework common exception types (IOException) or basic method return types (String), failing to simulate injection of custom complex object types and custom exception types. While chaosblade implements some custom exception and custom type fault simulation, its support for injecting these types of faults in container environments is limited to the container level, not the pod or node level, indicating insufficient layer support.

[0004] It is evident that there is currently no commercially available method for uniformly injecting custom return value complex object types and throwing custom exception types in the field of chaos engineering. Therefore, there is an urgent need for a method for simulating custom type faults in Java programs that can address the shortcomings of custom fault type simulation in chaos engineering. This method should not only be able to inject custom complex object types into method return values ​​but also inject custom exception types into methods. Furthermore, this method should be applicable to simulating this type of fault at various levels in different infrastructure environments, including virtual machines and containers. Summary of the Invention

[0005] In view of this, the present invention provides a method and apparatus for simulating custom type faults in Java programs to solve at least one of the aforementioned problems.

[0006] To achieve the above objectives, the present invention adopts the following solution:

[0007] According to a first aspect of the present invention, a method for simulating custom type faults in a Java program is provided. The method includes: defining a template for injecting custom exception types and returning complex object types in a Java program based on a custom type fault model; inputting fault rule parameters through the template defined by the custom type fault model to generate fault rule instances; loading and parsing the fault rule instances to obtain parsed data; invoking the JVM to execute fault injection corresponding to the fault rule based on the parsed data, and returning the fault injection simulation result.

[0008] According to a second aspect of the present invention, a device for simulating custom type faults in a Java program is provided. The device method includes: a template definition unit, used to define templates for injecting custom exception types and returning complex object types in a Java program based on a custom type fault model; an instance generation unit, used to generate fault rule instances by inputting fault rule parameters through the template defined by the custom type fault model; a loading and parsing unit, used to load and parse the fault rule instances to obtain parsed data; and an execution unit, used to call the JVM to execute fault injection corresponding to the fault rule based on the parsed data, and return the fault injection simulation result.

[0009] According to a third aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.

[0010] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0011] According to a fifth aspect of the present invention, a computer program product is provided, comprising a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.

[0012] As can be seen from the above technical solutions, the custom-type fault simulation method and apparatus in Java programs provided in this application can achieve the purpose of injecting custom return values ​​of complex object types and custom exception types, and this method can be applied to different underlying infrastructure environments such as virtual machines and containers. Therefore, this application not only improves the types of fault simulation in the field of chaos engineering, but also extends to dynamically injecting various types and exceptions at runtime in Java programs in container and virtual machine environments. This provides testers with an effective means of quality assurance, improves testing efficiency, and facilitates the coding, debugging, and self-testing process for developers. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:

[0014] Figure 1 This is a flowchart illustrating a custom-type fault simulation method in a Java program, as provided in an embodiment of this application.

[0015] Figure 2 This is a schematic diagram of the template definition process provided in an embodiment of this application;

[0016] Figure 3 This is a schematic diagram of an example of loading and parsing fault rules provided in an embodiment of this application;

[0017] Figure 4 This is a flowchart illustrating a custom type fault simulation method in a Java program, provided in another embodiment of this application.

[0018] Figure 5 This is a schematic diagram of the structure of a custom type fault simulation device in a Java program provided in an embodiment of this application;

[0019] Figure 6 This is a schematic diagram of the structure of a template definition unit provided in an embodiment of this application;

[0020] Figure 7 This is a schematic diagram of the structure of a custom-type fault simulation device in a Java program, provided in another embodiment of this application;

[0021] Figure 8 This is a schematic block diagram of the system configuration of the electronic device provided in the embodiments of this application. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0023] First, a brief introduction to the technical terms used in this application:

[0024] The term "JVM" is an abbreviation for Java Virtual Machine, a virtual machine. By using the JVM, platform-specific information is shielded, allowing Java compilers to generate only the target code (bytecode) that runs on the JVM, enabling it to run on multiple platforms without modification.

[0025] The term "custom type" refers to a complex data type that maps and describes real-world entities. Unlike pre-defined basic types like strings and integers, custom types are reference data types defined by the programmer.

[0026] The term "fault simulation" refers to injecting faults into the system to test its response by simulating possible faults in the production environment, such as business response timeouts, CPU overload, disk failures, and thread pool overload. By discovering problems in the system, continuous optimization can be performed to improve the system's fault tolerance and robustness.

[0027] like Figure 1 The diagram shown is a flowchart of a custom type fault simulation method in a Java program according to an embodiment of this application. This fault simulation is part of a chaos experiment, and the method includes the following steps:

[0028] Step S101: Based on the custom type fault model, complete the template definition for custom exception type injection and return complex object type injection in the Java program.

[0029] In this embodiment, the custom-type fault model is an abstract model based on a large amount of JVM chaos experimental data, and it is the basic model on which the fault simulation method of this application is based.

[0030] Preferred, such as Figure 2 As shown, this step can specifically include the following sub-steps for template definition:

[0031] Step S1011: Obtain custom type fault simulation data generated during the artificial fault simulation practice. The custom type faults include custom type exceptions and faults that return complex object types.

[0032] Step S1012: Analyze the elements and events required for the custom type fault simulation.

[0033] Step S1013: Obtain a custom type fault model based on the elements and events, and define a template for it.

[0034] Preferably, the custom type fault model obtained in this embodiment can be the following model:

[0035]

[0036] Based on the model description above, this custom type fault model includes: rules, classes, methods, and `do` operation events. Defining this custom type fault model as a template completes the template definition for custom exception type injection and complex object type injection in Java programs.

[0037] Step S102: Input fault rule parameters through the template defined by the custom type fault model to generate fault rule instances.

[0038] Preferably, corresponding to the custom-type fault model described above, the fault rule parameters input in this step may include: rule name (RuleName), class name of the injected fault (ClassName), method name (MethodName), and fault behavior (do) operation event. By inputting the above fault rule parameters based on the template, different fault rule instances can be generated. The following example demonstrates specific fault rule instances using the simulation of a complex object return value fault of a custom type and the injection of custom exceptions.

[0039] For simulating faults in the return values ​​of complex objects of custom types, in actual experiments, even if it's a custom type, this type is already abstractly defined and is not an undefined type in the program. Therefore, if the class to which the fault is injected in the defined rule does not exist, it will directly cause the experiment to fail with an error. Below is an example of a fault rule that generates a custom "student" return value:

[0040]

[0041] The following is an example of a specific fault rule for injecting a custom exception, which can throw a new exception "BOOM":

[0042]

[0043] Step S103: Load and parse the fault rule instance to obtain parsed data.

[0044] This step loads and parses the source data of the fault rule instance generated in step S102, and then transmits the parsed data to the subsequent execution rule module to execute the specific chaotic experiment fault rule, that is, to inject the corresponding fault.

[0045] Selectable, such as Figure 3As shown, this step may specifically include: determining the operation event type based on the fault rule parameters in the fault rule instance, that is, based on... Figure 3 The operation event type is determined by the rule name, class name, method name, and do operation event. The operation event type can include fault flag type and custom type. The fault flag type includes returning a specified value and throwing a specified exception, with values ​​of (return, throw). The specific values ​​of the corresponding custom type are (return value type, exception type).

[0046] The final parsed data is the following data tuple:

[0047] [Rule name, class name, method name, fault flag type, custom type].

[0048] Step S104: Based on the parsed data, call the JVM to execute the fault injection corresponding to the fault rule, and return the fault injection simulation result.

[0049] This step involves performing fault injection via the JVM. It uses the data tuples from the parsed data as input parameters and then calls the JVM to execute instructions based on these input parameters to dynamically modify the program's bytecode, thereby altering its behavior. Upon completion, the result of the fault injection simulation will be returned, allowing users to observe whether the experiment was successful. If an error occurs, specific error information will also be displayed.

[0050] As described above, the custom-type fault simulation method in Java programs provided in this application can achieve the purpose of injecting custom return values ​​of complex object types and custom exception types. Furthermore, this method is applicable to different underlying infrastructure environments such as virtual machines and containers. Therefore, this application not only improves the types of fault simulation in the field of chaos engineering but also extends to dynamically injecting various types and exceptions at runtime in Java programs within container and virtual machine environments. This provides testers with an effective means of quality assurance, improves testing efficiency, and facilitates the coding, debugging, and self-testing process for developers.

[0051] like Figure 4 The diagram shown is a flowchart of a custom type fault simulation method in a Java program according to another embodiment of this application. The method includes the following steps:

[0052] Step S401: Based on the custom type fault model, complete the template definition for custom exception type injection and return complex object type injection in the Java program.

[0053] Step S402: Input fault rule parameters using the template defined by the custom type fault model to generate fault rule instances.

[0054] Step S403: Load and parse the fault rule instance to obtain parsed data.

[0055] Step S404: Based on the parsed data, call the JVM to execute the fault injection corresponding to the fault rule, and return the fault injection simulation result.

[0056] Preferably, the fault injection simulation results returned to the user in this step are {Experiment ID, and Experiment Result}.

[0057] Step S405: Send the recovery command to the chaos experiment engine using the experiment ID as an input parameter.

[0058] Step S406: The chaos experiment engine queries the database for execution operations based on the experiment ID.

[0059] Step S407: The chaos experiment engine performs a recovery operation through reverse operation, and returns the experiment ID and recovery experiment result after the recovery operation is completed, so that users can observe whether the recovery operation was successful.

[0060] As described above, the custom-type fault simulation method in Java programs provided in this application can achieve the purpose of injecting custom return values ​​of complex object types and custom exception types. Furthermore, this method is applicable to different underlying infrastructure environments such as virtual machines and containers. Therefore, this application not only improves the types of fault simulation in the field of chaos engineering but also extends to dynamically injecting various types and exceptions into Java programs at runtime in container and virtual machine environments. This provides testers with an effective means of quality assurance while improving testing efficiency and facilitating the coding, debugging, and self-testing process for developers. Finally, after performing fault injection, this application can also reverse the injected operations to restore the data, ensuring no loss to the Java program.

[0061] like Figure 5 The diagram shows a structural schematic of a custom type fault simulation device in a Java program provided in an embodiment of this application. The device includes a template definition unit 510, an instance generation unit 520, a loading and parsing unit 530, and an execution unit 540, which are connected in sequence.

[0062] Template definition unit 510 is used to define templates for injecting custom exception types and returning complex object types in Java programs based on custom type fault models.

[0063] The instance generation unit 520 is used to generate fault rule instances by inputting fault rule parameters through the template defined by the custom type fault model.

[0064] The loading and parsing unit 530 is used to load and parse the fault rule instance to obtain parsed data.

[0065] The execution unit 540 is used to call the JVM to perform fault injection corresponding to the fault rule according to the parsed data, and return the fault injection simulation result.

[0066] Preferred, such as Figure 6 As shown, the template definition unit 510 may include: a simulation data acquisition module 511, an analysis module 512, and a template definition module 513, wherein the analysis module 512 is connected to the simulation data acquisition module 511 and the template definition module 513 respectively.

[0067] The simulation data acquisition module 511 is used to acquire custom type fault simulation data generated during the artificial fault simulation practice. The custom type faults include custom type exceptions and faults that return complex object types.

[0068] Analysis module 512 is used to analyze the elements and events required for custom-type fault simulation;

[0069] The template definition module 513 is used to obtain a custom type fault model based on the elements and events, and to define a template for it.

[0070] Preferably, the above fault rule parameters include the rule name, the class name of the injected fault, the method name, and the fault behavior do operation event.

[0071] Preferably, the above-mentioned loading and parsing unit 530 can be specifically used to: determine the operation event type based on the fault rule parameters in the fault rule instance, wherein the operation event type includes fault marker type and custom type; the parsed data is a data tuple including rule name, class name, method name, fault marker type and custom type.

[0072] Preferably, the above-mentioned fault flag types include returning a specified value and throwing a specified exception, and the custom types include return value type and exception type.

[0073] Preferably, the returned fault injection simulation results may include the experiment ID and the experiment results, such as... Figure 7 As shown, the apparatus of this embodiment may further include: a recovery instruction sending unit 550, which is used to send a recovery instruction to the chaos experiment engine with the experiment ID as an input parameter, and the chaos experiment engine queries the execution operation in the database according to the experiment ID to perform the recovery operation through reverse operation, and returns the experiment ID and the recovery experiment result after the recovery operation is completed.

[0074] For a detailed description of each of the above units, please refer to the descriptions corresponding to the aforementioned method embodiments, which will not be repeated here.

[0075] As described above, the custom-type fault simulation device for Java programs provided in this application can achieve the purpose of injecting custom return values ​​of complex object types and custom exception types. Furthermore, this method is applicable to different underlying infrastructure environments such as virtual machines and containers. Therefore, this application not only improves the types of fault simulation in the field of chaos engineering but also extends to dynamically injecting various types and exceptions into Java programs at runtime in container and virtual machine environments. This provides testers with an effective means of quality assurance while improving testing efficiency and facilitating the coding, debugging, and self-testing process for developers. Finally, after performing fault injection, this application can also reverse the injected operations to restore the data, ensuring no loss to the Java program.

[0076] This invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described method.

[0077] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the above-described method.

[0078] This invention also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the above-described method.

[0079] like Figure 8 As shown, the electronic device 600 may also include: a communication module 110, an input unit 120, an audio processor 130, a display 160, and a power supply 170. It is worth noting that the electronic device 600 does not necessarily need to include these components. Figure 8 All components shown; in addition, the electronic device 600 may also include Figure 8 For components not shown, please refer to existing technologies.

[0080] like Figure 8 As shown, the central processing unit 100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device. The central processing unit 100 receives inputs and controls the operation of various components of the electronic device 600.

[0081] The memory 140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 100 may execute the program stored in the memory 140 to perform information storage or processing, etc.

[0082] Input unit 120 provides input to central processing unit 100. Input unit 120 may be, for example, a keypad or touch input device. Power supply 170 provides power to electronic device 600. Display 160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.

[0083] The memory 140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as ERPOM, etc. The memory 140 can also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage unit 142 for storing application programs and function programs or processes for executing the operation of the electronic device 600 via the central processing unit 100.

[0084] The memory 140 may also include a data storage unit 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 144 of the memory 140 may include various drivers for the electronic device's communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0085] The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processing unit 100 to provide input signals and receive output signals, which can be the same as in a conventional mobile communication terminal.

[0086] Based on different communication technologies, multiple communication modules 110 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide audio output via the speaker 131 and receive audio input from the microphone 132, thereby enabling typical telecommunications functions. The audio processor 130 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 130 is coupled to a central processing unit 100, enabling on-device recording via the microphone 132 and on-device playback of stored audio via the speaker 131.

[0087] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0088] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0089] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0090] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0091] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

Claims

1. A method for simulating custom-type faults in a Java program, characterized in that, The method includes: Based on the custom type fault model, template definitions are completed for custom exception type injection and return complex object type injection in Java programs. The custom type fault model includes: rules, class, methods, and do operation events. The fault rule instance is generated by inputting fault rule parameters through the template defined by the custom type fault model. The fault rule parameters include the rule name, the class name of the injected fault, the method name, and the fault behavior do operation event. Load and parse the fault rule instance to obtain parsed data; Based on the parsed data, the JVM is invoked to execute the fault injection corresponding to the fault rule, and the fault injection simulation result is returned; The parsed data obtained by loading and parsing the fault rule instance includes: The operation event type is determined based on the fault rule parameters in the fault rule instance. The operation event type includes fault mark type and custom type. The custom type is a reference data type defined by the programmer. The parsed data consists of data tuples including rule name, class name, method name, fault flag type, and custom type.

2. The method for simulating custom-type faults in a Java program as described in claim 1, characterized in that, The template definition for injecting custom exception types and returning complex object types in Java programs based on the custom type fault model includes: Acquire custom-type fault simulation data generated during the artificial fault simulation practice, wherein the custom-type faults include custom-type exceptions and faults that return complex object types; Analyze the elements and events required for custom-type fault simulation; A custom type fault model is obtained based on the elements and events, and a template is defined for it.

3. The method for simulating custom-type faults in a Java program as described in claim 1, characterized in that, The fault flag types include returning a specified value and throwing a specified exception, and the custom types include return value type and exception type.

4. The method for simulating custom-type faults in a Java program as described in claim 1, characterized in that, The returned fault injection simulation results include the experiment ID and the experiment results. The method further includes: The experiment ID is used as an input parameter to send a recovery command to the chaos experiment engine; The chaos experiment engine queries the database for execution operations based on the experiment ID; The recovery operation is performed by reversing the operation, and the experiment ID and recovery results are returned after the recovery operation is completed.

5. A fault simulation device for a custom type in a Java program, characterized in that, The apparatus and method include: The template definition unit is used to define templates for injecting custom exception types and returning complex object types in a Java program based on a custom type fault model. The custom type fault model includes: rules, class, methods, and do operation events. The instance generation unit is used to generate a fault rule instance by inputting fault rule parameters through the template defined by the custom type fault model. The fault rule parameters include the rule name, the class name of the injected fault, the method name, and the fault behavior do operation event. A parsing unit is used to load and parse the fault rule instance to obtain parsed data; An execution unit is used to call the JVM to execute fault injection corresponding to the fault rule based on the parsed data, and return the fault injection simulation result; The loading and parsing unit is specifically used to: determine the operation event type based on the fault rule parameters in the fault rule instance, wherein the operation event type includes fault marker type and custom type, and the custom type is a reference data type defined by the programmer; the parsed data is a data tuple including rule name, class name, method name, fault marker type and custom type.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 4.